[Bug 38248] New: Staff interface record display - adding a lost status to an item causes "Processing" when viewing the record
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Bug ID: 38248 Summary: Staff interface record display - adding a lost status to an item causes "Processing" when viewing the record Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Staff interface Assignee: koha-bugs@lists.koha-community.org Reporter: david@davidnind.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com If I set the lost status for an item to 1 (Lost), then when viewing the record in the staff interface, it sits on "Processing". To replicate: 1. Find any record in the staff interface with an existing item and add a new item. 2. Note that when you select the "Normal" view, the holdings section lists the existing item and the new one that you created. 3. Edit the item you created and change "1 - Lost status" to "Lost". 4. Select the "Normal" view for the record again and note that a dialog box appears saying "Processing" and the holdings table does not list any items. -- 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=38248 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33568 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33568 [Bug 33568] Use the REST API to display items on the staff biblio detail view -- 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=38248 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27919 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27919 [Bug 27919] Split claims return from LOST -- 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=38248 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- If you set "ClaimReturnedLostValue" to "Lost", you get a different error as well. I get a JS alert() that says: 400: Bad Request. Not in enum list: <with a long list that I'm not going to write out> -- I'm guessing I might just need to rebuild my API files... -- 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=38248 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #1)
If you set "ClaimReturnedLostValue" to "Lost", you get a different error as well.
I get a JS alert() that says:
400: Bad Request. Not in enum list: <with a long list that I'm not going to write out>
--
I'm guessing I might just need to rebuild my API files...
Yep, rebuild the swagger spec and restarted, and now it's fine. This should be an easy fix... -- 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=38248 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=38248 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Created attachment 173241 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173241&action=edit Bug 38248: Fix condition when item has no return_claims in API response This change just fixes a condition to not break when an item has no return_claims in an API response. Test plan: 0) Apply the patch and koha-plack --restart kohadev NOTE: You may need to rebuild your swagger spec since bug 27919 was pushed redocly bundle --ext json api/v1/swagger/swagger.yaml \ --output api/v1/swagger/swagger_bundle.json 1) Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 2) Create an item with a status of "Lost" 3) Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 4) Note that the item table loads without a problem 5) In system preferences, set the ClaimReturnedLostValue syspref to any value 6) Checkout an item to a patron 7) Click "Claim returned" and make the claim 8) Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 9) Note that the item table loads without a problem and "(Claimed returned") appears for the item that was claimed returned -- 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=38248 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- 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=38248 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Staff interface record |Staff interface detail page |display - adding a lost |item table lookup fails |status to an item causes |when item has lost status |"Processing" when viewing |but no claims returned |the record | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Phil Ringnalda <phil@chetcolibrary.org> 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=38248 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173241|0 |1 is obsolete| | --- Comment #4 from Phil Ringnalda <phil@chetcolibrary.org> --- Created attachment 173250 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173250&action=edit Bug 38248: Fix condition when item has no return_claims in API response This change just fixes a condition to not break when an item has no return_claims in an API response. Test plan: 0) Apply the patch and koha-plack --restart kohadev NOTE: You may need to rebuild your swagger spec since bug 27919 was pushed redocly bundle --ext json api/v1/swagger/swagger.yaml \ --output api/v1/swagger/swagger_bundle.json 1) Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 2) Create an item with a status of "Lost" 3) Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 4) Note that the item table loads without a problem 5) In system preferences, set the ClaimReturnedLostValue syspref to any value 6) Checkout an item to a patron 7) Click "Claim returned" and make the claim 8) Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 9) Note that the item table loads without a problem and "(Claimed returned") appears for the item that was claimed returned Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil@chetcolibrary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Simple change and tested it. PQA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- I am wondering if the condition is correct. What would make sense IMO is to test for ClaimReturnedLostValue We should have row.return_claims set if the pref is set 248 [% IF Koha.Preference('ClaimReturnedLostValue') %] 249 embed.push('return_claims'); 250 [% END %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #7)
I am wondering if the condition is correct. What would make sense IMO is to test for ClaimReturnedLostValue
We should have row.return_claims set if the pref is set
248 [% IF Koha.Preference('ClaimReturnedLostValue') %] 249 embed.push('return_claims'); 250 [% END %]
We now have claimed returns items with LOST values other than the ClaimReturendLostValue. (See bug 27919) So this is why this needed to be adjusted. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 --- Comment #9 from Jonathan Druart <jonathan.druart@gmail.com> --- Then remove the embed condition? rows.return_claims won't be set if the pref is not set. Should be on bug 27919 maybe. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #9)
rows.return_claims won't be set if the pref is not set.
row.return_claims not being set is the whole problem resolved by this patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 --- Comment #11 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Cook from comment #10)
(In reply to Jonathan Druart from comment #9)
rows.return_claims won't be set if the pref is not set.
row.return_claims not being set is the whole problem resolved by this patch
Look at the code: 248 [% IF Koha.Preference('ClaimReturnedLostValue') %] 249 embed.push('return_claims'); 250 [% END %] 497 const hasReturnClaims = row.return_claims && row.return_claims.filter(rc => !rc.resolution).length > 0 ? true : false This means that if the pref is not set, row.return_claims won't be set (the key will not exist). If the pref is set, row.return_claims will be an array (eventually empty). A correct logic would be surround the 'hasReturnClaims' code with test on ClaimReturnedLostValue. if ( row.lost_status ) { let lost_lib = av_lost.get(row.lost_status.toString()) || _("Unavailable (lost or missing"); [% IF Koha.Preference('ClaimReturnedLostValue') %] const hasReturnClaims = row.return_claims.filter(rc => !rc.resolution).length > 0 ? true : false nodes += '<span class="lost">%s</span>'.format(escape_str(lost_lib)); if(hasReturnClaims) { nodes += '<span class="claimed_returned">' + _("(Claimed returned)") + '</span>'; } [% END %] } *BUT* (In reply to Katrin Fischer from comment #8)
(In reply to Jonathan Druart from comment #7)
I am wondering if the condition is correct. What would make sense IMO is to test for ClaimReturnedLostValue
We should have row.return_claims set if the pref is set
248 [% IF Koha.Preference('ClaimReturnedLostValue') %] 249 embed.push('return_claims'); 250 [% END %]
We now have claimed returns items with LOST values other than the ClaimReturendLostValue. (See bug 27919) So this is why this needed to be adjusted.
Then following the above, there is a flaw in the logic. If this is correct we should always embed return_claims, and remove the IF l.248 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 --- Comment #12 from David Cook <dcook@prosentient.com.au> --- If you have the time to deal with it, I'd say go for it. Personally, I have bigger fish to fry... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 --- Comment #13 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Cook from comment #12)
If you have the time to deal with it, I'd say go for it. Personally, I have bigger fish to fry...
Do you think I enjoy dealing with those silly things? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 --- Comment #14 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 173704 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173704&action=edit Bug 38248: Do not deal with return claims if pref is not set If the pref is not set we don't embed return_claims and so row.return_claims will never be set. When the pref is on, row.return_claims should always be an array. Test plan: Same as previous patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.blenkinsop@ptfs-europe | |.com --- Comment #15 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #14)
Created attachment 173704 [details] [review] Bug 38248: Do not deal with return claims if pref is not set
If the pref is not set we don't embed return_claims and so row.return_claims will never be set. When the pref is on, row.return_claims should always be an array.
Test plan: Same as previous patch
Requesting Matt's signoff, please. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173704|0 |1 is obsolete| | --- Comment #16 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 173708 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173708&action=edit Bug 38248: Do not deal with return claims if pref is not set If the pref is not set we don't embed return_claims and so row.return_claims will never be set. When the pref is on, row.return_claims should always be an array. Test plan: Same as previous patch Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 --- Comment #17 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Good catch, patch works as advertised and the logic makes sense -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 --- Comment #18 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Follow-up Bug 38248: Do not deal with return claims if pref is not set grabbed for push to main. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED CC| |lucas@bywatersolutions.com Resolution|--- |FIXED --- Comment #19 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Missing 24.05.x dependencies, no backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38248 Bug 38248 depends on bug 33568, which changed state. Bug 33568 Summary: Use the REST API to display items on the staff biblio detail view https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33568 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org