Bug 28228

Summary: Warns from plugins when metadata value not defined for key
Product: Koha Reporter: Nick Clemens <nick>
Component: Plugin architectureAssignee: Kyle M Hall <kyle>
Status: CLOSED FIXED QA Contact: Joonas Kylmälä <joonas.kylmala>
Severity: normal    
Priority: P5 - low CC: cornejo.alvaro, fridolin.somers, joonas.kylmala
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11
Bug Depends on:    
Bug Blocks: 25790    
Attachments: Bug 28228: Supress plugin related error message
Bug 28228: Supress plugin related error message
Bug 28228: Supress plugin related error message

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