[Bug 28600] New: Variable "$patron" is not available

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 28600] New: Variable "$patron" is not available

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28600

            Bug ID: 28600
           Summary: Variable "$patron" is not available
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: ASSIGNED
          Severity: major
          Priority: P5 - low
         Component: OPAC
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]
        Depends on: 18989

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.


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18989
[Bug 18989] Allow displaying biblios with all items hidden by OpacHiddenItems
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 28600] Variable "$patron" is not available

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28600

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rel_21_05_candidate

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 28600] Variable "$patron" is not available

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28600

--- Comment #1 from Tomás Cohen Arazi <[hidden email]> ---
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.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 28600] Variable "$patron" is not available

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28600

--- Comment #2 from Tomás Cohen Arazi <[hidden email]> ---
Created attachment 122171
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122171&action=edit
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 <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/