[Koha-bugs] [Bug 10217] New: Make sure direct links to detail views work when there is no session

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed May 8 11:56:50 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10217

            Bug ID: 10217
           Summary: Make sure direct links to detail views work when there
                    is no session
    Classification: Unclassified
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: ASSIGNED
          Severity: critical
          Priority: P5 - low
         Component: OPAC
          Assignee: magnus at enger.priv.no
          Reporter: magnus at enger.priv.no

On current master, if you do not have a session and try to visit a detail view
page you will get an error:

Can't use an undefined value as a HASH reference at
/home/magnus/scripts/kohadev/opac/opac-detail.pl line 445.

The offending line looks like this:

my $branch = C4::Context->userenv->{branch};

This will typically happen if you follow a direct link to a detail view in an
OPAC you have not visited before, or not visited in such a long time that the
session expired. 

If you get the error, visit the front page and go back to the detail view that
gave the error it will work, because visiting the front page establishes a new
session:

<rangi> you dont have a userenv
<rangi> if you arent logged in
<magnuse> that makes sense :-) 
<magnuse> but... do you get one by visiting the front page, then? 
<rangi> yep
<rangi> starts an anonymous session
<magnuse> and that only happens on the front page? 
<rangi> or search results
<rangi> doesnt happen on detail page
<rangi> and it shouldnt
<rangi> cos else google would spawn a zillion sessions

Huge thanks to Chris C. who suggested the fix for this, but did not want to
submit a patch for it. :-) 

The problem was caused by Bug 7740. There was a similar problem in
opac-serach.pl, fixed on Bug 9980.

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


More information about the Koha-bugs mailing list