Bug 37014 - "Item was not checked in" printed on next POST because of missing supplementary form
Summary: "Item was not checked in" printed on next POST because of missing supplementa...
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P3 normal
Assignee: Andrii Nugged
QA Contact: Lucas Gass
URL:
Keywords:
: 37296 (view as bug list)
Depends on: 8461
Blocks:
  Show dependency treegraph
 
Reported: 2024-06-03 03:14 UTC by Andrii Nugged
Modified: 2024-07-25 22:59 UTC (History)
12 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes a check in issue where the message "Item was not checked in" was appearing in the due date column of the checked-in items table. This was occurring when an action was required for an item after it was checked in, for example when the item needed transferring to another library.
Version(s) released in:
24.11.00,24.05.02,23.11.07
Circulation function:


Attachments
(screenshot and diagram of a potential bug) (564.25 KB, image/png)
2024-06-03 03:14 UTC, Andrii Nugged
Details
Bug 37014: Fix after-modal-POST to transmit "not_returned" message (10.17 KB, patch)
2024-06-03 06:43 UTC, Andrii Nugged
Details | Diff | Splinter Review
Bug 37014: Fix after-modal-POST to transmit "not_returned" message (10.17 KB, patch)
2024-06-03 06:44 UTC, Andrii Nugged
Details | Diff | Splinter Review
Bug 37014: Fix after-modal-POST to transmit "not_returned" message (10.35 KB, patch)
2024-06-03 11:31 UTC, HKS3 Tadeusz Sośnierz
Details | Diff | Splinter Review
Bug 37014: Fix after-modal-POST to transmit "not_returned" message (10.40 KB, patch)
2024-06-20 17:40 UTC, Lucas Gass
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrii Nugged 2024-06-03 03:14:01 UTC
Created attachment 167332 [details]
(screenshot and diagram of a potential bug)

This "not_returned" feature computation logic and:

    [% IF ( riloo.not_returned ) %]
        <span class="problem">Item was not checked in</span>
    [% END %]

Our production servers started to show "Item was not checked in" for items that had just been checked in (also for manual check-in).

I noticed that this happens on the second load. I.e., when there was a modal, grayed-out content under modal is shown correctly: there is no "not checked in" message, but then circ/returns.pl page reloaded, form POST'ed again, and on next screen, it shows this "not checked in" additional message, on the next after modal, page.
Comment 1 Andrii Nugged 2024-06-03 06:43:34 UTC Comment hidden (obsolete)
Comment 2 Andrii Nugged 2024-06-03 06:44:17 UTC
Created attachment 167336 [details] [review]
Bug 37014: Fix after-modal-POST to transmit "not_returned" message

The bug report addresses an issue where the message "Item was not checked in" erroneously appears during the second POST after a manual or modal check-in process.

1. In circ/returns.pl:
   - Introduced a new hash `%rinot_returned` to track items not returned across pages.
   - Updated the logic to capture the "not returned" status from the query parameters.
   - Adjusted the input processing loop to include `not_returned` status.
   - Modified the section handling barcode check-ins to appropriately initialize and update the `not_returned` status.

2. returns.tt:
   - Added hidden input fields in the template to include `not_returned` status in the form submissions.

The changes ensure that the "not_returned" status is correctly tracked and displayed, preventing the erroneous message from appearing on subsequent POST requests.

1. Perform a manual check-in of an item, but make some warning modal appear: for ex., transfer: check-in the item in not home library.
2. Press OK on the modal. There will be a POST transition again to redraw the checked-in items list.
3. Verify that the "Item was not checked in" message appears erroneously near the item's row.
4. Apply the patch.
5. Repeat steps 1-3 and check that there will be no erroneous "Item was not checked in" message.
Comment 3 HKS3 Tadeusz Sośnierz 2024-06-03 11:31:18 UTC
Created attachment 167341 [details] [review]
Bug 37014: Fix after-modal-POST to transmit "not_returned" message

The bug report addresses an issue where the message "Item was not checked in" erroneously appears during the second POST after a manual or modal check-in process.

1. In circ/returns.pl:
   - Introduced a new hash `%rinot_returned` to track items not returned across pages.
   - Updated the logic to capture the "not returned" status from the query parameters.
   - Adjusted the input processing loop to include `not_returned` status.
   - Modified the section handling barcode check-ins to appropriately initialize and update the `not_returned` status.

2. returns.tt:
   - Added hidden input fields in the template to include `not_returned` status in the form submissions.

The changes ensure that the "not_returned" status is correctly tracked and displayed, preventing the erroneous message from appearing on subsequent POST requests.

1. Perform a manual check-in of an item, but make some warning modal appear: for ex., transfer: check-in the item in not home library.
2. Press OK on the modal. There will be a POST transition again to redraw the checked-in items list.
3. Verify that the "Item was not checked in" message appears erroneously near the item's row.
4. Apply the patch.
5. Repeat steps 1-3 and check that there will be no erroneous "Item was not checked in" message.

Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>
Comment 4 Andreas Jonsson 2024-06-20 07:29:22 UTC
We have started to see this since the upgrade to 23.11.06.

I think this should be given a higher priority as the faulty message is confusing and annoying.
Comment 5 Lucas Gass 2024-06-20 17:40:10 UTC
Created attachment 167940 [details] [review]
Bug 37014: Fix after-modal-POST to transmit "not_returned" message

The bug report addresses an issue where the message "Item was not checked in" erroneously appears during the second POST after a manual or modal check-in process.

1. In circ/returns.pl:
   - Introduced a new hash `%rinot_returned` to track items not returned across pages.
   - Updated the logic to capture the "not returned" status from the query parameters.
   - Adjusted the input processing loop to include `not_returned` status.
   - Modified the section handling barcode check-ins to appropriately initialize and update the `not_returned` status.

2. returns.tt:
   - Added hidden input fields in the template to include `not_returned` status in the form submissions.

The changes ensure that the "not_returned" status is correctly tracked and displayed, preventing the erroneous message from appearing on subsequent POST requests.

1. Perform a manual check-in of an item, but make some warning modal appear: for ex., transfer: check-in the item in not home library.
2. Press OK on the modal. There will be a POST transition again to redraw the checked-in items list.
3. Verify that the "Item was not checked in" message appears erroneously near the item's row.
4. Apply the patch.
5. Repeat steps 1-3 and check that there will be no erroneous "Item was not checked in" message.

Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 6 Katrin Fischer 2024-06-21 13:04:25 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 7 Laura O'Neil 2024-07-03 13:17:51 UTC
Could this be backported to 24.05?
Comment 8 Andreas Jonsson 2024-07-03 13:49:11 UTC
The patch applies without issues on 23.11.06.
Comment 9 Lucas Gass 2024-07-09 21:46:12 UTC
*** Bug 37296 has been marked as a duplicate of this bug. ***
Comment 10 Lucas Gass 2024-07-11 20:05:09 UTC
Backported to 24.05.x for upcomin 24.05.02
Comment 11 Fridolin Somers 2024-07-15 07:39:51 UTC
Pushed to 23.11.x for 23.11.07
Comment 12 wainuiwitikapark 2024-07-19 01:30:18 UTC
not backporting to 23.05.x unless requested