[Bug 27509] New: cn_sort value is lost when editing an item without changing cn_source or itemcallnumber
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Bug ID: 27509 Summary: cn_sort value is lost when editing an item without changing cn_source or itemcallnumber Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: critical Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl To recreate: - Create a new item with a cn_source value and an itemcallnumber value - write a quick report to see the cn_sort value: SELECT cn_sort FROM items WHERE itemnumber=your itemnumber, see your item has a cn_sort value - edit your item and save it without changing either the cn_source of the itemcallnumber - run your report again, cn_sort is now null - edit your item, changing either the cn_source or itemcallnumber - run report again, cn_sort is back! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mkstephens@lancasterseminar | |y.edu, | |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |23463 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23463 [Bug 23463] Move C4::Items CRUD subroutines to Koha::Item -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org CC| |jonathan.druart@bugs.koha-c | |ommunity.org Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115575&action=edit Bug 27509: Prevent cn_sort value to be lost when editing items This is a bit dirty, cn_sort is not passed from the UI but built in Koha::Item->store depending on the values of itemcallnumber and cn_source. It must be updated only if one of those 2 attributes are modified. The problem is that, as it's not passed, $item->{cn_sort} does not exist, and set_or_blank will set it to undef. The trick here is to backup the value before set_or_blank and set it back to the item object. Another solution would be to force the processing of cn_sort each time we call Koha::Item->store. I don't think that's a good idea. Test plan: - Create a new item with a cn_source value and an itemcallnumber value - write a quick report to see the cn_sort value: SELECT cn_sort FROM items WHERE itemnumber=your itemnumber, see your item has a cn_sort value - edit your item and save it without changing either the cn_source of the itemcallnumber - run your report again, cn_sort is not modified - edit your item, changing either the cn_source or itemcallnumber - run report again, cn_sort is modified as expected -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115575|0 |1 is obsolete| | --- Comment #2 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 115577 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115577&action=edit Bug 27509: Prevent cn_sort value to be lost when editing items This is a bit dirty, cn_sort is not passed from the UI but built in Koha::Item->store depending on the values of itemcallnumber and cn_source. It must be updated only if one of those 2 attributes are modified. The problem is that, as it's not passed, $item->{cn_sort} does not exist, and set_or_blank will set it to undef. The trick here is to backup the value before set_or_blank and set it back to the item object. Another solution would be to force the processing of cn_sort each time we call Koha::Item->store. I don't think that's a good idea. Test plan: - Create a new item with a cn_source value and an itemcallnumber value - write a quick report to see the cn_sort value: SELECT cn_sort FROM items WHERE itemnumber=your itemnumber, see your item has a cn_sort value - edit your item and save it without changing either the cn_source of the itemcallnumber - run your report again, cn_sort is not modified - edit your item, changing either the cn_source or itemcallnumber - run report again, cn_sort is modified as expected Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115577|0 |1 is obsolete| | --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 115579 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115579&action=edit Bug 27509: Prevent cn_sort value to be lost when editing items This is a bit dirty, cn_sort is not passed from the UI but built in Koha::Item->store depending on the values of itemcallnumber and cn_source. It must be updated only if one of those 2 attributes are modified. The problem is that, as it's not passed, $item->{cn_sort} does not exist, and set_or_blank will set it to undef. The trick here is to backup the value before set_or_blank and set it back to the item object. Another solution would be to force the processing of cn_sort each time we call Koha::Item->store. I don't think that's a good idea. Test plan: - Create a new item with a cn_source value and an itemcallnumber value - write a quick report to see the cn_sort value: SELECT cn_sort FROM items WHERE itemnumber=your itemnumber, see your item has a cn_sort value - edit your item and save it without changing either the cn_source of the itemcallnumber - run your report again, cn_sort is not modified - edit your item, changing either the cn_source or itemcallnumber - run report again, cn_sort is modified as expected Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115579|0 |1 is obsolete| | --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 115580 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115580&action=edit Bug 27509: Prevent cn_sort value to be lost when editing items This is a bit dirty, cn_sort is not passed from the UI but built in Koha::Item->store depending on the values of itemcallnumber and cn_source. It must be updated only if one of those 2 attributes are modified. The problem is that, as it's not passed, $item->{cn_sort} does not exist, and set_or_blank will set it to undef. The trick here is to backup the value before set_or_blank and set it back to the item object. Another solution would be to force the processing of cn_sort each time we call Koha::Item->store. I don't think that's a good idea. Test plan: - Create a new item with a cn_source value and an itemcallnumber value - write a quick report to see the cn_sort value: SELECT cn_sort FROM items WHERE itemnumber=your itemnumber, see your item has a cn_sort value - edit your item and save it without changing either the cn_source of the itemcallnumber - run your report again, cn_sort is not modified - edit your item, changing either the cn_source or itemcallnumber - run report again, cn_sort is modified as expected Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115579|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115580|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|21.05.00 |21.05.00,20.11.02 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|21.05.00,20.11.02 |21.05.00,20.11.02,20.05.08 released in| | --- Comment #7 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 20.05.x for 20.05.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED CC| |victor@tuxayo.net --- Comment #8 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Missing dependencies for 19.11.x, it shouldn't be affected, no backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=27843 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pgm0203@comcast.net --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- *** Bug 27843 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509 Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marjorie.barry-vila@collect | |o.ca -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org