| Summary: | Variable "$patron" is not available | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
| Component: | OPAC | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
| Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
| Severity: | major | ||
| Priority: | P5 - low | CC: | dcook, fridolin.somers, kyle, m.de.rooy |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 |
| Patch complexity: | Small patch | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: |
21.11.00,21.05.01
|
Circulation function: | |
| Bug Depends on: | 18989 | ||
| Bug Blocks: | |||
| Attachments: |
Bug 28600: Resolve variable scope issue
Bug 28600: Resolve variable scope issue Bug 28600: Resolve variable scope issue |
||
|
Description
Jonathan Druart
2021-06-18 14:16:47 UTC
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 |