PHP Fatal Error: Uncaught Error: Class 'collection' not found

Hello,

I’m working on fixing an Omeka instance that crashes while loading with the following error and stack trace:

 PHP Fatal error:  Uncaught Error: Class 'collection' not found in /var/www/ophope/htdocs/application/libraries/Omeka/Db/Table.php:682
Stack trace:
#0 /var/www/ophope/htdocs/application/libraries/Omeka/Db/Table.php(653): Omeka_Db_Table->recordFromData(Array)
#1 /var/www/ophope/htdocs/application/libraries/Omeka/Db/Table.php(281): Omeka_Db_Table->fetchObjects(Object(Omeka_Db_Select))
#2 /var/www/ophope/htdocs/application/libraries/globals.php(1740): Omeka_Db_Table->findBy(Array, 1)
#3 /var/www/ophope/htdocs/themes/foundation/functions.php(79): get_records('collection', Array, 1)
#4 /var/www/ophope/htdocs/themes/foundation/index.php(8): foundation_random_featured_records_html('collection')
#5 /var/www/ophope/htdocs/application/libraries/Omeka/View.php(114): include('/var/www/ophope...')\n#6 /var/www/ophope/htdocs/application/libraries/Zend/View/Abstract.php(888): Omeka_View->_run('/var/www/ophope...')
#7 /var/www/ophope/htdocs/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(912): Zend_View_Abstract->render(NUL in /var/www/ophope/htdocs/application/libraries/Omeka/Db/Table.php on line 682

The instance is running on PHP 7.1.32, in Ubuntu 16.04 LTS.

I haven’t seen any instances of this error being reported anywhere – and I’m wondering if this might be caused by a plugin?

I don’t see any references to plugin code in the stack trace, but the instance was working fine until I installed a few plugins.

Plugins installed:

drwxr-xr-x  7 www-data www-data    4096 Nov 13 18:09 BatchUpload
drwxr-xr-x  3 www-data www-data    4096 Jan 28  2020 Coins
drwxr-xr-x  8 www-data www-data    4096 Nov 13 18:09 CsvImport
drwxr-xr-x  8 www-data www-data    4096 Nov 13 18:09 Dropbox
drwxr-xr-x  9 www-data www-data    4096 Jan 28  2020 ExhibitBuilder
drwxr-xr-x  4 www-data www-data    4096 Nov 13 18:09 ExhibitImageAnnotation
drwxr-xr-x 17 www-data www-data    4096 Nov 13 18:09 Neatline
drwxr-xr-x  3 www-data www-data    4096 Nov 13 18:09 PodcastFeed
drwxr-xr-x  8 www-data www-data    4096 Jan 28  2020 SimplePages
drwxr-xr-x  6 www-data www-data    4096 Nov 13 18:09 VimeoImport

Thank you!

As I was formatting the above post I noticed a reference to the Foundation theme in the stack trace.

Looks like that might be a good starting point, and I will try to manually switch it out for another to see if that helps.

Is there a way to edit the database directly to switch themes? Going to try to remove the theme files but I wonder if Omeka will be OK with that.

Do you have an admin login for that site? The theme only applies on the “frontend” so you should just be able to go to /admin and log in and change the theme as normal.

If necessary though, you can edit the theme in the database directly, it’s in the options table. You could also move the theme out of the way and put another one in its place (like, make a copy of the “default” theme and call it “foundation”).

Hi @mannyr.lh, I’ve released a new version of the theme that should have a fix for you. If you’re still seeing issues, I’ll see what I can do.

This topic was automatically closed after 250 days. New replies are no longer allowed.