Bug 7796

Summary: C4/VirtualShelves.pm needs globally scoped $dbh for plack
Product: Koha Reporter: Dobrica Pavlinusic <dpavlin>
Component: ListsAssignee: Dobrica Pavlinusic <dpavlin>
Status: CLOSED INVALID QA Contact: Ian Walls <koha.sekjal>
Severity: enhancement    
Priority: P5 - low CC: alex.arnaud
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 7172    
Attachments: Bug 7796 - C4/VirtualShelves.pm needs globally scoped $dbh for plack
Bug 7796 - C4/VirtualShelves.pm $dbh plack scoping

Description Dobrica Pavlinusic 2012-03-22 11:19:10 UTC

    
Comment 1 Dobrica Pavlinusic 2012-03-22 11:21:02 UTC Comment hidden (obsolete)
Comment 2 Dobrica Pavlinusic 2012-03-22 16:09:10 UTC
Created attachment 8531 [details] [review]
Bug 7796 - C4/VirtualShelves.pm $dbh plack scoping

we get a lot of "MySQL server has gone away" error messages and
defining global $dbh isn't the best solution. Existing code
gets $dbh from context in some subs, so this change makes it always
use $dbh from context.
Comment 3 Alex Arnaud 2012-03-27 08:48:33 UTC
Dobrica, could you give me more details about how to reproduce the bug?
I didn't get such errors when browsing shelves.
Comment 4 Dobrica Pavlinusic 2012-03-27 12:21:14 UTC
It seems that I can't reproduce it right now (silly me for not recoording URL to example together with bug).

I changed bug status and if I don't find it again this week, I will close it with WONTFIX
Comment 5 Dobrica Pavlinusic 2012-03-28 15:20:31 UTC
Today, I got this error again. Accessing /cgi-bin/koha/catalogue/search.pl?idx=&q=human

DBD::mysql::db selectall_arrayref failed: MySQL server has gone away at /srv/koha/C4/VirtualShelves.pm line 202.
DBD::mysql::db selectall_arrayref failed: MySQL server has gone away at /srv/koha/C4/VirtualShelves.pm line 214.
DBD::mysql::db selectall_arrayref failed: MySQL server has gone away at /srv/koha/C4/VirtualShelves.pm line 202.
DBD::mysql::db selectall_arrayref failed: MySQL server has gone away at /srv/koha/C4/VirtualShelves.pm line 214.

I have virtualshelves "allow" in syspreference.

Even more interesting, after restart I got different error:

DBD::mysql::db selectall_arrayref failed: Unknown column 'allow_add' in 'where clause' at /srv/koha/C4/VirtualShelves.pm line 202.
DBD::mysql::db selectall_arrayref failed: Unknown column 'allow_add' in 'where clause' at /srv/koha/C4/VirtualShelves.pm line 214.

Which got me thinking... I was using database from version 3.07.00.019 which explains why VirtualShelves which got changed in 3.07.00.032 didn't work.

I'm closing this ticket, although I sould re-visit question why plack didn't force me to upgrade database to current version.