Bug 25516: Fix for "Can't call method unblessed on unblessed reference"
authorPetro Vashchuk <stalkernoid@gmail.com>
Mon, 18 May 2020 11:45:56 +0000 (14:45 +0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 19 May 2020 07:29:34 +0000 (08:29 +0100)
commit8efa607ae58ecb83e4b6088633f4b302abfe4822
tree5b145aa268b896b23ddb85cf4669e3306a8db6a1
parent048a6cfc02e7f72159e3345a36e8496528fe68ca
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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
reserve/request.pl