Bug 7796 - C4/VirtualShelves.pm needs globally scoped $dbh for plack
Summary: C4/VirtualShelves.pm needs globally scoped $dbh for plack
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Dobrica Pavlinusic
QA Contact: Ian Walls
URL:
Keywords:
Depends on:
Blocks: 7172
  Show dependency treegraph
 
Reported: 2012-03-22 11:19 UTC by Dobrica Pavlinusic
Modified: 2012-10-26 00:51 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 7796 - C4/VirtualShelves.pm needs globally scoped $dbh for plack (660 bytes, patch)
2012-03-22 11:21 UTC, Dobrica Pavlinusic
Details | Diff | Splinter Review
Bug 7796 - C4/VirtualShelves.pm $dbh plack scoping (4.22 KB, patch)
2012-03-22 16:09 UTC, Dobrica Pavlinusic
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.