Bug 23034

Summary: Warning when in Mana KB settings Auto subscription sharing is unchecked
Product: Koha Reporter: Joonas Kylmälä <joonas.kylmala>
Component: Mana-kbAssignee: Joonas Kylmälä <joonas.kylmala>
Status: CLOSED FIXED QA Contact: Nick Clemens <nick>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, lucas, martin.renvoize, nick
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Who signed the patch off: Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.02
Attachments: 0001-Bug-23034-Remove-uninitialized-value-warning-in-Mana
Bug 23034: Remove uninitialized value warning in Mana KB settings
Bug 23034: Remove uninitialized value warning in Mana KB settings

Description Joonas Kylmälä 2019-06-03 14:53:55 UTC
If you go to the page /cgi-bin/koha/admin/share_content.pl and unselect the checkbox "Auto subscription sharing" you will get following warning to plack-error.log: "Use of uninitialized value $auto_share in string ne at /home/koha/kohaclone/admin/share_content.pl line 49."
Comment 1 Joonas Kylmälä 2019-06-03 15:17:41 UTC
Created attachment 90273 [details] [review]
0001-Bug-23034-Remove-uninitialized-value-warning-in-Mana

Here is a patch to remove the warning.
Comment 2 Martin Renvoize 2019-06-19 11:35:44 UTC
Created attachment 90776 [details] [review]
Bug 23034: Remove uninitialized value warning in Mana KB settings

This gets rid of the warning "Use of uninitialized value $auto_share
in string ne at [...]" by initializing the variable with empty string.

Test plan:
1) Go to page cgi-bin/koha/admin/share_content.pl and unselect "Auto
   subscription sharing". Click "Save".
2) Check plack-error.log and notice the warning "Use of uninitialized
   value $auto_share [...]"
3) Apply the patch and repeat the previous steps but now this time the
   warning is gone in plack-error.log.
4) Make sure the AutoShareWithMana syspref with and without the patch
   is in unselected state after clicking "Save".

Sponsored-by: The National Library of Finland
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2019-06-19 11:36:52 UTC
Works well, thanks for the patch.
Comment 4 Nick Clemens 2019-06-21 15:59:19 UTC
Created attachment 90922 [details] [review]
Bug 23034: Remove uninitialized value warning in Mana KB settings

This gets rid of the warning "Use of uninitialized value $auto_share
in string ne at [...]" by initializing the variable with empty string.

Test plan:
1) Go to page cgi-bin/koha/admin/share_content.pl and unselect "Auto
   subscription sharing". Click "Save".
2) Check plack-error.log and notice the warning "Use of uninitialized
   value $auto_share [...]"
3) Apply the patch and repeat the previous steps but now this time the
   warning is gone in plack-error.log.
4) Make sure the AutoShareWithMana syspref with and without the patch
   is in unselected state after clicking "Save".

Sponsored-by: The National Library of Finland
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Martin Renvoize 2019-06-24 13:50:42 UTC
Nice work!

Pushed to master for 19.11.00
Comment 6 Martin Renvoize 2019-06-24 14:48:13 UTC
Nice work!

Pushed to master for 19.11.00
Comment 7 Fridolin Somers 2019-07-16 06:48:26 UTC
Pushed to 19.05.x for 19.05.02
Comment 8 Lucas Gass 2019-07-23 15:18:16 UTC
no backport for 18.11.x