Created attachment 8499 [details] [review] Bug 7796 - C4/VirtualShelves.pm needs globally scoped $dbh for plack otherwise, we get a lot of "MySQL server has gone away" error messages
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.
Dobrica, could you give me more details about how to reproduce the bug? I didn't get such errors when browsing shelves.
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
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.