Summary: | Item/pickup_locations wantarray removed, so dies on Perl >=5.24 where "autoderef" feature absent | ||
---|---|---|---|
Product: | Koha | Reporter: | Andrii Nugged <nugged> |
Component: | Hold requests | Assignee: | Peter Vashchuk <stalkernoid> |
Status: | CLOSED FIXED | QA Contact: | Jonathan Druart <jonathan.druart> |
Severity: | critical | ||
Priority: | P5 - low | CC: | 1joynelson, gmcharlt, jonathan.druart, martin.renvoize, slavashishkin, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
20.05.00
|
Circulation function: | |
Bug Depends on: | 24368 | ||
Bug Blocks: | |||
Attachments: |
Bug 25516: Fix for "Can't call method unblessed on unblessed reference"
Bug 25516: Fix for "Can't call method unblessed on unblessed reference" Bug 25516: Fix for "Can't call method unblessed on unblessed reference" |
Description
Andrii Nugged
2020-05-15 15:10:19 UTC
Are you planning on submitting a patch soon? I'd like 2. to be part of 20.05. Created attachment 105012 [details] [review] Bug 25516: Fix for "Can't call method unblessed on unblessed reference" Software error: Can't call method "unblessed" on unblessed reference at ../reserve/request.pl line 581. was caused by recent commit with `wantarray` removal in sub pickup_locations in ‘Item.pm’ and visible on fresher Perls (where experimental feature "autoderef" removed https://www.effectiveperlprogramming.com/2010/11/use-array-references-with-the-array-operators/ ) To test: 1) Get a clean dev environment after "reset_all" 2) Add an empty record for “Default checkout, hold and return policy” on /cgi-bin/koha/admin/smart-rules.pl. 3) Open item record, like /cgi-bin/koha/reserve/request.pl?biblionumber=1&borrowernumber=1 4) Observe the error (Can't call method "unblessed" on unblessed reference at ../reserve/request.pl line 581.) 5) Apply patch. 6) Repeat steps 2 and 3. 7) Observe that the error is gone. Created attachment 105040 [details] [review] Bug 25516: Fix for "Can't call method unblessed on unblessed reference" Software error: Can't call method "unblessed" on unblessed reference at ../reserve/request.pl line 581. was caused by recent commit with `wantarray` removal in sub pickup_locations in ‘Item.pm’ and visible on fresher Perls (where experimental feature "autoderef" removed https://www.effectiveperlprogramming.com/2010/11/use-array-references-with-the-array-operators/ ) To test: 1) Get a clean dev environment after "reset_all" 2) Add an empty record for “Default checkout, hold and return policy” on /cgi-bin/koha/admin/smart-rules.pl. 3) Open item record, like /cgi-bin/koha/reserve/request.pl?biblionumber=1&borrowernumber=1 4) Observe the error (Can't call method "unblessed" on unblessed reference at ../reserve/request.pl line 581.) 5) Apply patch. 6) Repeat steps 2 and 3. 7) Observe that the error is gone. Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> It works ! :D Created attachment 105058 [details] [review] Bug 25516: Fix for "Can't call method unblessed on unblessed reference" Software error: Can't call method "unblessed" on unblessed reference at ../reserve/request.pl line 581. was caused by recent commit with `wantarray` removal in sub pickup_locations in ‘Item.pm’ and visible on fresher Perls (where experimental feature "autoderef" removed https://www.effectiveperlprogramming.com/2010/11/use-array-references-with-the-array-operators/ ) To test: 1) Get a clean dev environment after "reset_all" 2) Add an empty record for “Default checkout, hold and return policy” on /cgi-bin/koha/admin/smart-rules.pl. 3) Open item record, like /cgi-bin/koha/reserve/request.pl?biblionumber=1&borrowernumber=1 4) Observe the error (Can't call method "unblessed" on unblessed reference at ../reserve/request.pl line 581.) 5) Apply patch. 6) Repeat steps 2 and 3. 7) Observe that the error is gone. Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Amended-patch: replace tab indentation with spaces Peter, thanks for the patch! Make sure you configure your editor correctly for this project, we use 4 spaces indentation, no tab ;) I amended the patch. Nice work everyone! Pushed to master for 20.05 (In reply to Jonathan Druart from comment #6) > Make sure you configure your editor correctly for this project, we use 4 spaces indentation, no tab ;) actually, git's config for 'whitespace' we all have: 'trailing-space,space-before-tab' to protect ourselves against occasional things like above, but it protects in space+tab, in another order, not tab+space, maybe we should try 'indent-with-non-tab,tab-in-indent' too... But now we even added this in our REGEX in team's pre-commit hook now :P missing dependency - not backported to 19.11.x |