[Koha-bugs] [Bug 25516] Item/pickup_locations wantarray removed, so dies on Perl >=5.24 where "autoderef" feature absent

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue May 19 09:19:38 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25516

Jonathan Druart <jonathan.druart at bugs.koha-community.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #105040|0                           |1
        is obsolete|                            |

--- Comment #5 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 105058
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105058&action=edit
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 at tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Amended-patch: replace tab indentation with spaces

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list