Bug 31737 - Undef warnings around unseen_renewals_allowed in smart-rules.pl
Summary: Undef warnings around unseen_renewals_allowed in smart-rules.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Slava Shishkin
QA Contact: Testopia
URL:
Keywords:
Depends on: 29012
Blocks:
  Show dependency treegraph
 
Reported: 2022-10-11 15:53 UTC by Slava Shishkin
Modified: 2023-06-08 22:26 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 31737: Fix undef warnings around unseen_renewals_allowed in smart-rules.pl (1.48 KB, patch)
2022-10-11 16:02 UTC, Slava Shishkin
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Slava Shishkin 2022-10-11 15:53:57 UTC Comment hidden (obsolete)
Comment 1 Slava Shishkin 2022-10-11 15:59:05 UTC
When UnseenRenewals syspref is disabled, the form param is not passed at all when parsed it comes as undef, but the code tries directly to do strip_non_numeric call on it. Thus the 'undef' warnings:

[WARN] Use of uninitialized value $string in substitution (s///) at /kohadevbox/koha/admin/smart-rules.pl line 760.
[WARN] Use of uninitialized value $string in pattern match (m//) at /kohadevbox/koha/admin/smart-rules.pl line 761.
Comment 2 Slava Shishkin 2022-10-11 16:02:50 UTC
Created attachment 141611 [details] [review]
Bug 31737: Fix undef warnings around unseen_renewals_allowed in smart-rules.pl

Trivial fix.

To reproduce:
1. Create or edit a rule on /cgi-bin/koha/admin/smart-rules.pl - i.e. submit the form (make POST request)
2. Notice the mentioned above warning in plack-intranet-error.log
3. Apply the patch.
4. Repeat step 1.
5. That warning in log file should be no more.
Comment 3 Kevin Carnes 2022-10-14 09:31:26 UTC
Thanks for catching this. It's been decided I should update the patch since it hasn't been released yet. I went ahead and included your fix.