Bug 15215

Summary: Remove Depreciation Errors due to misuse of UNIVERSAL in SIP/Sip/MsgType.pm
Product: Koha Reporter: Colin Campbell <colin.campbell>
Component: SIP2Assignee: Colin Campbell <colin.campbell>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: colin.campbell, f.demians, tomascohen
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:
Attachments: Proposed patch
[SIGNED-OFF] Bug 15215: Remove warning due to misuse of UNIVERSAL
[PASSED QA] Bug 15215: Remove warning due to misuse of UNIVERSAL

Description Colin Campbell 2015-11-19 12:04:40 UTC
Compiling C4/SIP/Sip/MsgType.pm generates the warning

UNIVERSAL->import is deprecated and will be removed in a future perl in perl 5.22 this is now a fatal error causing compilation to abort with the message 'UNIVERSAL does not export anything'. (And e.g. crashing Koha's test suite fairly early on)

replace invalid call to UNIVERSAL with a use UNIVERSAL::can to avoid this
Comment 1 Colin Campbell 2015-11-19 12:27:28 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2015-11-20 11:50:04 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2015-11-20 14:00:26 UTC
Created attachment 45043 [details] [review]
[PASSED QA] Bug 15215: Remove warning due to misuse of UNIVERSAL

Calling UNIVERSAL's internal methods will cause a depreciation
warning in perls less that 5.22 as of 5.22 the warning is a fatal
error causing compilation to abort

Replace the use UNIVERSAL with UNIVERSAL::can to work around the
buggy construct perldoc UNIVERSAL::can for more info

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No more worning/error
No qa errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Tomás Cohen Arazi 2015-11-20 14:25:02 UTC
Patch pushed to master.

Thanks Colin!
Comment 5 Frédéric Demians 2015-11-29 21:13:05 UTC
This patch has been pushed to 3.20.x, will be in 3.20.6.