In the logs: Variable "$patron" is not available at /kohadevbox/koha/opac/opac-detail.pl line 282 Coming from commit 8de3d9a95f2f3a01b5ed309805d81c698ac8e550 Bug 18989: (QA follow-up) Make controllers use Koha::Biblio->hidden_in_opac - 'category' => $borcat + 'category' => ($patron) ? $patron->categorycode : q{} It's in a sub, and patron is declared outside.
Ha, $borcat (which I replaced with $patron) was defined as (our) -our $borcat= q{}; -if ( C4::Context->preference('OpacHiddenItemsExceptions') ) { - $borcat = $patron ? $patron->categorycode : q{}; -} I guess I overlooked it. Patch coming.
Created attachment 122171 [details] [review] Bug 28600: Resolve variable scope issue This patch fixes a scope issue. Originally, a variable declared as our $borcat was replaced by my $patron This patch makes the method not rely on global variables, but have a parameter for the patron, and thus things are clearer. To test: 1. Open the OPAC detail page for a record => FAIL: The logs show some errors about the $patron variable not available in the scope 2. Apply this patch 3. Repeat 1 => SUCCESS: No errors 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 122207 [details] [review] Bug 28600: Resolve variable scope issue This patch fixes a scope issue. Originally, a variable declared as our $borcat was replaced by my $patron This patch makes the method not rely on global variables, but have a parameter for the patron, and thus things are clearer. To test: 1. Open the OPAC detail page for a record => FAIL: The logs show some errors about the $patron variable not available in the scope 2. Apply this patch 3. Repeat 1 => SUCCESS: No errors 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 122338 [details] [review] Bug 28600: Resolve variable scope issue This patch fixes a scope issue. Originally, a variable declared as our $borcat was replaced by my $patron This patch makes the method not rely on global variables, but have a parameter for the patron, and thus things are clearer. To test: 1. Open the OPAC detail page for a record => FAIL: The logs show some errors about the $patron variable not available in the scope 2. Apply this patch 3. Repeat 1 => SUCCESS: No errors 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 21.11, thanks to everybody involved!
(In reply to Jonathan Druart from comment #5) > Pushed to master for 21.11, thanks to everybody involved! Pushed to 21.05.x for 21.05.01
Depends on Bug 18989 not is 20.11.x