Bug 28228 - Warns from plugins when metadata value not defined for key
Summary: Warns from plugins when metadata value not defined for key
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Joonas Kylmälä
URL:
Keywords:
: 27161 (view as bug list)
Depends on:
Blocks: 25790
  Show dependency treegraph
 
Reported: 2021-04-26 14:38 UTC by Nick Clemens
Modified: 2021-10-06 20:15 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11


Attachments
Bug 28228: Supress plugin related error message (1.09 KB, patch)
2021-04-26 14:40 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 28228: Supress plugin related error message (1.13 KB, patch)
2021-09-11 07:29 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 28228: Supress plugin related error message (1.28 KB, patch)
2021-09-11 13:26 UTC, Joonas Kylmälä
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-04-26 14:38:02 UTC

    
Comment 1 Kyle M Hall 2021-04-26 14:40:41 UTC
Created attachment 120176 [details] [review]
Bug 28228: Supress plugin related error message

Use of uninitialized value in subroutine entry at /usr/share/koha/lib/Koha/Plugins/Base.pm line 182.

Test Plan:
1) Install the Kitchen Sink plugin ( it does not have a max versio defined )
2) Note the warning in your logs
3) Apply this patch
4) Restart all the things
5) No warning!
Comment 2 Fridolin Somers 2021-09-11 07:29:51 UTC
Created attachment 124789 [details] [review]
Bug 28228: Supress plugin related error message

Use of uninitialized value in subroutine entry at /usr/share/koha/lib/Koha/Plugins/Base.pm line 182.

Test Plan:
1) Install the Kitchen Sink plugin ( it does not have a max versio defined )
2) Note the warning in your logs
3) Apply this patch
4) Restart all the things
5) No warning!

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 3 Fridolin Somers 2021-09-11 08:03:58 UTC
*** Bug 27161 has been marked as a duplicate of this bug. ***
Comment 4 Joonas Kylmälä 2021-09-11 13:20:32 UTC
I don't see how this patch does anything, and thus unable to even reproduce the problem. The problem should have been fixed already by "Bug 24361: (bug 24217 follow-up) Fix several warnings in C4 modules". Is the information about this concering master branch correct?

The $metadata->{$_} part is false if it is undef so it should not proceed to the next statement.
Comment 5 Joonas Kylmälä 2021-09-11 13:26:43 UTC
Created attachment 124795 [details] [review]
Bug 28228: Supress plugin related error message

Use of uninitialized value in subroutine entry at /usr/share/koha/lib/Koha/Plugins/Base.pm line 182.

Test Plan:
1) Install the Kitchen Sink plugin ( it does not have a max versio defined )
2) Note the warning in your logs
3) Apply this patch
4) Restart all the things
5) No warning!

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 6 Joonas Kylmälä 2021-09-11 13:27:54 UTC
It at least fixes the strings where they evaluate to false, like 0, so this is still a good patch to take in but I don't see still how this fixes any warnings.
Comment 7 Jonathan Druart 2021-09-20 12:47:16 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 8 Kyle M Hall 2021-10-01 17:44:41 UTC
Pushed to 21.05.x for 21.05.05
Comment 9 Fridolin Somers 2021-10-06 20:15:19 UTC
Pushed to 20.11.x for 20.11.11