[Koha-bugs] [Bug 2392] New: New [0] array references in Auth.pm "crashing" Koha in Perl 5.10.0

bugzilla-daemon at pippin.metavore.com bugzilla-daemon at pippin.metavore.com
Thu Jul 24 03:46:40 CEST 2008


http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=2392

           Summary: New [0] array references in Auth.pm "crashing" Koha in
                    Perl 5.10.0
           Product: Koha
           Version: HEAD
          Platform: PC
        OS/Version: Linux - Suse
            Status: NEW
          Severity: blocker
          Priority: P3
         Component: Virtual Shelves
        AssignedTo: jmf at liblime.com
        ReportedBy: ricmarques at spamcop.net
         QAContact: koha-bugs at lists.koha.org


I'm using openSUSE 11.0 (that runs Perl 5.10.0).

I downloaded the latest Koha "snapshot" development version from git:

http://git.koha.org/cgi-bin/gitweb.cgi?p=Koha;a=snapshot;h=9575a5f4fe84fc0b109062ad084ab32e3cc28a23

After running "perl Makefile.PL", "make test" and "make install", I accessed
the OPAC and got the usual message: "System Maintenance ... we'll be back soon!
If you have any questions, please contact the Site Administrator"

I logged in the Intranet (running on Port 8080) as "kohaadmin" and ran
(successfully) the steps of the Web Installer.


The problem happened at the end of the Web Installer, when I tried to access
the OPAC. I got the following error message in the browser:

____________________ 

Koha error 
The following fatal error has occurred: 
Can't use string ("1") as an ARRAY ref while "strict refs" in use at
/usr/share/koha/lib/C4/Auth.pm line 743.
____________________ 


Line 743 of "Auth.pm" reads as this: 

$session->param('pubshelves', ${@$pubshelves}[0]);


I'm only a beginner Perl coded, but I had a suspicion that the problem might be
related to this curious  ${@$pubshelves}[0]  syntax used to point to the first
instance of the "pubshelves" array. 

So I replaced every instance of ${@$pubshelves}[0] by $pubshelves->[0] and also
replaced every instance of ${@$barshelves}[0] by $barshelves->[0]  ... and the
problem went away!  :)


I'm assuming that I found this problem because I'm using Perl 5.10.0 and the
coder of these array references may have used a previous version of Perl (e.g:
5.8.8) that probably does not display the same behavior regarding this: 

perldelta - what is new for perl 5.10.0 - search.cpan.org 
http://search.cpan.org/dist/perl-5.10.0/pod/perl5100delta.pod




------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.



More information about the Koha-bugs mailing list