Bug 40866

Summary: Weird and untranslatable message appears every time something is checked out
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: Staff interfaceAssignee: Hammat wele <hammat.wele>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: caroline.cyr-la-rose, gmcharlt, hammat.wele, michael.hafen, paul.derscheid, philippe.blouin
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 9762    
Bug Blocks:    
Attachments: Bug 40866: Fix incorrect display of override message on normal checkouts
Bug 40866: Make message translatable
Bug 40866: Move or remove other variables added with the message
Bug 40866: Fix incorrect display of override message on normal checkouts

Description Lucas Gass (lukeg) 2025-09-23 19:35:11 UTC
To test:

1. Check a thing out to a patron, any patron and any thing. 
2. See the message "No patron matched Restriction overridden temporarily"

This seems to be a product of 9762.

The string also seems to be untranslatable: 
Bug https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9762#c117
Comment 1 Paul Derscheid 2025-09-26 16:08:30 UTC
Created attachment 186985 [details] [review]
Bug 40866: Fix incorrect display of override message on normal checkouts

- The message "No patron matched Restriction overridden temporarily" was appearing on every checkout, even when no restriction override occurred.
- This was caused by the message being set unconditionally after AddIssue in circ/circulation.pl.
- The fix moves the message assignment inside the if ($issueconfirmed) block, ensuring it only displays when an override is actually confirmed.

To test:
1. Check out an item to a patron normally.
2. "Restriction overridden temporarily" message appears.
3. Apply patches
4. Repeat 1.
5. Verify that no "Restriction overridden temporarily" message appears.
6. Check out an item that requires an override (e.g., not for loan item with AllowNotForLoanOverride enabled).
7. Confirm the override in the UI.
8. Verify that the "Restriction overridden temporarily" message now appears.
9. Sign-off
Comment 2 Paul Derscheid 2025-09-26 16:08:32 UTC
Created attachment 186986 [details] [review]
Bug 40866: Make message translatable
Comment 3 Paul Derscheid 2025-09-26 16:09:24 UTC
Note sure whether that is the best place for that message given that we have to introduce Koha::I18N?
Comment 4 Michael Hafen 2025-09-29 17:16:39 UTC
I would like to upload alternate patchs that moves or removes the other variables that were introduced by bug 9762, if that is ok.
Comment 5 Paul Derscheid 2025-09-29 17:24:13 UTC
Nah, it's too late for that @Michael Hafen.
Fixing issues in the original bugs post push to maintenance branches always causes confusion.
If the patches in this bug are not sufficient, add more or open a new bug, please :)
Comment 6 Michael Hafen 2025-09-29 17:26:48 UTC
I will add a patch to this bug then.  I would like these variables to be kept together.
Thank you.

(In reply to Paul Derscheid from comment #5)
> Nah, it's too late for that @Michael Hafen.
> Fixing issues in the original bugs post push to maintenance branches always
> causes confusion.
> If the patches in this bug are not sufficient, add more or open a new bug,
> please :)
Comment 7 Michael Hafen 2025-09-29 17:31:42 UTC
Created attachment 187063 [details] [review]
Bug 40866: Move or remove other variables added with the  message
Comment 8 Hammat wele 2025-09-30 16:45:40 UTC
Created attachment 187116 [details] [review]
Bug 40866: Fix incorrect display of override message on normal checkouts

- The message 'No patron matched Restriction overridden temporarily' was appearing on every checkout, even when no restriction override occurred.
- This was caused by the message being set unconditionally after AddIssue in circ/circulation.pl.
- The message should not appear in circulation.pl, but in the Log Viewer.

To test:

1. Check out an item to a patron normally.
2. 'Restriction overridden temporarily' message appears.
3. Apply patches
4. Repeat 1.
  ---> Verify that no 'Restriction overridden temporarily' message appears.
5. Check out an item that requires an override (e.g., not for loan item with AllowNotForLoanOverride enabled).
  ---> Verify that no 'Restriction overridden temporarily' message appears.
6. Go to Tool -> Log viewer.
7. Enter the borrowernumber in Object field and submit.
  ---> Verify that the 'Restriction overridden temporarily' message is logged correctly.
Comment 9 Hammat wele 2025-09-30 16:45:57 UTC
The message 'Restriction overridden temporarily' is not meant to appear in circulation.pl, but in the Log Viewer (see Bug 9762).