[Bug 28472] New: UpdateItemLocationOnCheckin not updating items where location is null
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Bug ID: 28472 Summary: UpdateItemLocationOnCheckin not updating items where location is null Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Staff Client Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com UpdateItemLocationOnCheckin can be set to update ALL items at checkin. But that ALL is excluding items where location is null. To recreate: - have a location CART - in UpdateItemLocationOnCheckin, enter "_ALL_: CART" - find an item with a shelving location, check it in, confirm it changes to CART - find an item with a NULL shelving location, check it in, confirm it doesn't go to CART -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |26581 CC| |nick@bywatersolutions.com --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- I broke this trying to stop a warning: Was: if ( $item->location ne $update_loc_rules->{_ALL_}) { Became: if ( defined $item->location && $item->location ne $update_loc_rules->{_ALL_}) { Should be: if ( ( defined $item->location && $item->location ne $update_loc_rules->{_ALL_}) || (!defined $item->location && $update_loc_rules->{_ALL_} ne "") ) { Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26581 [Bug 26581] Elasticsearch - Records can be indexed multiple times during returns -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |a.roussos@dataly.gr |ity.org | Status|NEW |ASSIGNED CC| |a.roussos@dataly.gr -- 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=28472 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 --- Comment #2 from Andreas Roussos <a.roussos@dataly.gr> --- Created attachment 122541 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122541&action=edit Bug 28472: handle items with NULL shelving location The UpdateItemLocationOnCheckin System Preference can be set to update the location of ALL items during check in, regardless of their shelving location. However, this does not currently work 100% as it is excluding items with no shelving location (i.e. value of NULL in the corresponding database field). This patch, based on the comment made by Nick Clemens, fixes that. Test plan (based on the original Bug Description by Andrew Fuerste-Henry): 1) Have a shelving location CART 2) In UpdateItemLocationOnCheckin, enter "_ALL_: CART" (without the quotes) 3) Check in an item that has a shelving location, confirm it changes to CART 4) Check in an item with a NULL shelving location, confirm it doesn't go to CART 5) Apply this patch 6) Repeat step 4): this time the item should move to the CART shelving location -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 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=28472 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122541|0 |1 is obsolete| | --- Comment #3 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 122547 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122547&action=edit Bug 28472: handle items with NULL shelving location The UpdateItemLocationOnCheckin System Preference can be set to update the location of ALL items during check in, regardless of their shelving location. However, this does not currently work 100% as it is excluding items with no shelving location (i.e. value of NULL in the corresponding database field). This patch, based on the comment made by Nick Clemens, fixes that. Test plan (based on the original Bug Description by Andrew Fuerste-Henry): 1) Have a shelving location CART 2) In UpdateItemLocationOnCheckin, enter "_ALL_: CART" (without the quotes) 3) Check in an item that has a shelving location, confirm it changes to CART 4) Check in an item with a NULL shelving location, confirm it doesn't go to CART 5) Apply this patch 6) Repeat step 4): this time the item should move to the CART shelving location 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=28472 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=28472 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122547|0 |1 is obsolete| | --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122749 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122749&action=edit Bug 28472: handle items with NULL shelving location The UpdateItemLocationOnCheckin System Preference can be set to update the location of ALL items during check in, regardless of their shelving location. However, this does not currently work 100% as it is excluding items with no shelving location (i.e. value of NULL in the corresponding database field). This patch, based on the comment made by Nick Clemens, fixes that. Test plan (based on the original Bug Description by Andrew Fuerste-Henry): 1) Have a shelving location CART 2) In UpdateItemLocationOnCheckin, enter "_ALL_: CART" (without the quotes) 3) Check in an item that has a shelving location, confirm it changes to CART 4) Check in an item with a NULL shelving location, confirm it doesn't go to CART 5) Apply this patch 6) Repeat step 4): this time the item should move to the CART shelving location 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=28472 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Status|Passed QA |Failed QA --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- The change is missing test coverage. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Hannah Co <hannah.co@northwestu.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hannah.co@northwestu.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 --- Comment #6 from Hannah Co <hannah.co@northwestu.edu> --- I don't believe this patch catches items in "processing" that should end up with no shelving location. I have a freshly updated 21.05, with this patch included. My system pref UpdateItemLocationOnCheckin contains "PROC: _PERM_". Check-in does not make any changes to a record with "PROC" location and no other shelving location assigned. New items are automatically created with location AND permanent_location both set as PROC. It seems that "PROC" and "CART" should never populate permanent_location. Can we prevent "PROC" from populating the permanent_location? Or, can we handle the situation where "PROC" exists in both permanent_location AND location, so the location is completely removed and replaced with NULL? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 --- Comment #7 from Andreas Roussos <a.roussos@dataly.gr> --- Created attachment 124989 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=124989&action=edit Bug 28472: (follow-up) add unit test for the case where location = NULL This patch adds an extra unit test, to cover the case where the UpdateItemLocationOnCheckin System Preference is set to "_ALL_: CART" and the item being returned has no shelving location set. Test plan: 1) Apply the patch provided earlier 2) prove -v t/db_dependent/Circulation/issue.t ...and sign off if all tests pass. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 --- Comment #8 from Andreas Roussos <a.roussos@dataly.gr> --- (In reply to Jonathan Druart from comment #5)
The change is missing test coverage. Hi Jonathan! I think I managed to write a test that covers this case, see my follow-up.
-- You are receiving this mail because: You are watching all bug changes.
I don't believe this patch catches items in "processing" that should end up with no shelving location. I have a freshly updated 21.05, with this patch included. My system pref UpdateItemLocationOnCheckin contains "PROC: _PERM_". Check-in does not make any changes to a record with "PROC" location and no other shelving location assigned.
New items are automatically created with location AND permanent_location both set as PROC. It seems that "PROC" and "CART" should never populate permanent_location. Can we prevent "PROC" from populating the permanent_location?
Or, can we handle the situation where "PROC" exists in both permanent_location AND location, so the location is completely removed and replaced with NULL? Hi Hannah! Perhaps I've misunderstood what you're describing in your comment, but to me it looks like it's a different scenario than the one in the Description of
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 --- Comment #9 from Andreas Roussos <a.roussos@dataly.gr> --- (In reply to Hannah Co from comment #6) this bug report. Perhaps your report deserves to be submitted as a new bug? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gveranis@dataly.gr -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 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=28472 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122749|0 |1 is obsolete| | --- Comment #10 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 125011 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125011&action=edit Bug 28472: handle items with NULL shelving location The UpdateItemLocationOnCheckin System Preference can be set to update the location of ALL items during check in, regardless of their shelving location. However, this does not currently work 100% as it is excluding items with no shelving location (i.e. value of NULL in the corresponding database field). This patch, based on the comment made by Nick Clemens, fixes that. Test plan (based on the original Bug Description by Andrew Fuerste-Henry): 1) Have a shelving location CART 2) In UpdateItemLocationOnCheckin, enter "_ALL_: CART" (without the quotes) 3) Check in an item that has a shelving location, confirm it changes to CART 4) Check in an item with a NULL shelving location, confirm it doesn't go to CART 5) Apply this patch 6) Repeat step 4): this time the item should move to the CART shelving location Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> 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=28472 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #124989|0 |1 is obsolete| | --- Comment #11 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 125012 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125012&action=edit Bug 28472: (follow-up) add unit test for the case where location = NULL This patch adds an extra unit test, to cover the case where the UpdateItemLocationOnCheckin System Preference is set to "_ALL_: CART" and the item being returned has no shelving location set. Test plan: 1) Apply the patch provided earlier 2) prove -v t/db_dependent/Circulation/issue.t ...and sign off if all tests pass. 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=28472 --- Comment #12 from Hannah Co <hannah.co@northwestu.edu> --- (In reply to Andreas Roussos from comment #9)
I don't believe this patch catches items in "processing" that should end up with no shelving location. I have a freshly updated 21.05, with this patch included. My system pref UpdateItemLocationOnCheckin contains "PROC: _PERM_". Check-in does not make any changes to a record with "PROC" location and no other shelving location assigned.
New items are automatically created with location AND permanent_location both set as PROC. It seems that "PROC" and "CART" should never populate permanent_location. Can we prevent "PROC" from populating the permanent_location?
Or, can we handle the situation where "PROC" exists in both permanent_location AND location, so the location is completely removed and replaced with NULL? Hi Hannah! Perhaps I've misunderstood what you're describing in your comment, but to me it looks like it's a different scenario than the one in the Description of
(In reply to Hannah Co from comment #6) this bug report. Perhaps your report deserves to be submitted as a new bug?
Hi Andreas, I can certainly start a new bug report - I can report a bug for my situation, but would it be better to create a bug that covers the whole issue of "UpdateItemLocationOnCheckin not updating items where location is null"? The _ALL_: CART issue discussed above is another highly specific case, and I don't quite understand why the fix for that doesn't help in my situation. I feel like there's a larger issue of location = NULL needing to be handled in all situations. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 --- Comment #13 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Hannah, just making sure you saw bug 28895. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Joonas Kylmälä <joonas.kylmala@iki.fi> 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=28472 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125011|0 |1 is obsolete| | Attachment #125012|0 |1 is obsolete| | --- Comment #14 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 125033 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125033&action=edit Bug 28472: handle items with NULL shelving location The UpdateItemLocationOnCheckin System Preference can be set to update the location of ALL items during check in, regardless of their shelving location. However, this does not currently work 100% as it is excluding items with no shelving location (i.e. value of NULL in the corresponding database field). This patch, based on the comment made by Nick Clemens, fixes that. Test plan (based on the original Bug Description by Andrew Fuerste-Henry): 1) Have a shelving location CART 2) In UpdateItemLocationOnCheckin, enter "_ALL_: CART" (without the quotes) 3) Check in an item that has a shelving location, confirm it changes to CART 4) Check in an item with a NULL shelving location, confirm it doesn't go to CART 5) Apply this patch 6) Repeat step 4): this time the item should move to the CART shelving location Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 --- Comment #15 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 125034 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125034&action=edit Bug 28472: (follow-up) add unit test for the case where location = NULL This patch adds an extra unit test, to cover the case where the UpdateItemLocationOnCheckin System Preference is set to "_ALL_: CART" and the item being returned has no shelving location set. Test plan: 1) Apply the patch provided earlier 2) prove -v t/db_dependent/Circulation/issue.t ...and sign off if all tests pass. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |joonas.kylmala@iki.fi |y.org | CC| |joonas.kylmala@iki.fi --- Comment #16 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- (In reply to Hannah Co from comment #12)
Hi Andreas, I can certainly start a new bug report - I can report a bug for my situation, but would it be better to create a bug that covers the whole issue of "UpdateItemLocationOnCheckin not updating items where location is null"? The _ALL_: CART issue discussed above is another highly specific case, and I don't quite understand why the fix for that doesn't help in my situation. I feel like there's a larger issue of location = NULL needing to be handled in all situations.
Opening a new bug report for your issue seems like the best idea, the problem here (by reading the code) is just specific to the _ALL_ configuration value and not to the other ones. Passing QA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125034|0 |1 is obsolete| | --- Comment #17 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 125050 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125050&action=edit Bug 28472: (follow-up) add unit test for the case where location = NULL This patch adds an extra unit test, to cover the case where the UpdateItemLocationOnCheckin System Preference is set to "_ALL_: CART" and the item being returned has no shelving location set. Test plan: 1) Apply the patch provided earlier 2) prove -v t/db_dependent/Circulation/issue.t ...and sign off if all tests pass. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> JD amended patch: use 'is' instead of 'ok' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.11.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=28472 --- Comment #18 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, 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=28472 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.11.00 |21.11.00,21.05.05 released in| | CC| |kyle@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #19 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.11.00,21.05.05 |21.11.00,21.05.05,20.11.11 released in| | CC| |fridolin.somers@biblibre.co | |m Status|Pushed to stable |Pushed to oldstable --- Comment #20 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED --- Comment #21 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28472 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #22 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- *** Bug 29981 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=28472 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=14576 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org