PHP error in Center Row theme

I’ve been struggling to get the Batch Uploader plugin to work, but the error message is suggesting the problem has to do with the theme:

[13-Feb-2024 16:26:17 UTC] PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /home/archive9/archiveiraq.org/themes/centerrow/items/show.php:9
Stack trace:
#0 /home/archive9/archiveiraq.org/application/libraries/Omeka/View.php(114): include()
#1 /home/archive9/archiveiraq.org/application/libraries/Zend/View/Abstract.php(889): Omeka_View->_run('/home/archive9/...')
#2 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(912): Zend_View_Abstract->render(NULL)
#3 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(933): Zend_Controller_Action_Helper_ViewRenderer->renderScript('items/show.php', NULL)
#4 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(972): Zend_Controller_Action_Helper_ViewRenderer->render()
#5 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#6 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#7 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('showAction')
#8 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#9 /home/archive9/archiveiraq.org/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(106): Zend_Controller_Front->dispatch()
#10 /home/archive9/archiveiraq.org/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#11 /home/archive9/archiveiraq.org/application/libraries/Omeka/Application.php(73): Zend_Application->run()
#12 /home/archive9/archiveiraq.org/index.php(23): Omeka_Application->run()
#13 {main}
  thrown in /home/archive9/archiveiraq.org/themes/centerrow/items/show.php on line 9

So I looked at line 9 in the show.php file and I see this:

$hasVisualMedia = (count($visualMedia) > 0);

Anyone know how to fix this?

Can you confirm what version of Center Row and Omeka Classic you’re using?

I’m using 3.1.2 for Omeka Classic, and in fact all the problems started after I updated Omeka. I was using version 1.6 of Center Row but just updated to the latest version is 1.7.2. I tried running another job, but got the same error message pointing to some sort of issue on line 9 of the show.php file. Any idea why?

The items/show.php in Center Row v1.7.2 is different in that it’s now relying on Omeka itself to provide the image viewer, whereas before the image viewer was setup within the theme. Line 9 is blank in the current version, so I need the exact updated error to be able to troubleshoot.

It’s either not logging an error (which is something that was happening the other day), or it’s logging the exact same number. The time in the error log doesn’t seem right, but maybe there’s another explanation for that.

[13-Feb-2024 19:52:45 UTC] PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /home/archive9/archiveiraq.org/themes/centerrow/items/show.php:9
Stack trace:
#0 /home/archive9/archiveiraq.org/application/libraries/Omeka/View.php(114): include()
#1 /home/archive9/archiveiraq.org/application/libraries/Zend/View/Abstract.php(889): Omeka_View->_run('/home/archive9/...')
#2 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(912): Zend_View_Abstract->render(NULL)
#3 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(933): Zend_Controller_Action_Helper_ViewRenderer->renderScript('items/show.php', NULL)
#4 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(972): Zend_Controller_Action_Helper_ViewRenderer->render()
#5 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#6 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#7 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('showAction')
#8 /home/archive9/archiveiraq.org/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#9 /home/archive9/archiveiraq.org/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(106): Zend_Controller_Front->dispatch()
#10 /home/archive9/archiveiraq.org/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#11 /home/archive9/archiveiraq.org/application/libraries/Omeka/Application.php(73): Zend_Application->run()
#12 /home/archive9/archiveiraq.org/index.php(23): Omeka_Application->run()
#13 {main}
  thrown in /home/archive9/archiveiraq.org/themes/centerrow/items/show.php on line 9

So, I think what may be happening here is that you just happened to notice an unrelated error message related to the theme. The messages you’ve shown here really wouldn’t have anything to do with an uploader plugin.

Are you seeing an “Omeka has encountered an error” page when you have the problem with the plugin, or something else? If so, you’d want to follow the manual instructions on retrieving error messages; they can be directly displayed in the page or logged to a file, but it’s a different log file than the general PHP error log that it looks like you’re looking at here.

Once I got the PHP-CLI path correct, I started seeing the following error displaying directly on the page:

[12-Feb-2024 19:10:22 UTC] PHP Warning:  Undefined array key "file_ingest_options" in /home/archive9/archiveiraq.org/application/models/Builder/Item.php on line 268 [12-Feb-2024 19:10:22 UTC] PHP Deprecated:  Creation of dynamic property Omeka_File_Ingest_Url::$_client is deprecated in /home/archive9/archiveiraq.org/application/libraries/Omeka/File/Ingest/Url.php on line 47 [12-Feb-2024 19:10:22 UTC] PHP Deprecated:  Creation of dynamic property Zend_Http_Client::$_stream_name is deprecated in /home/archive9/archiveiraq.org/application/libraries/Zend/Http/Client.php on line 982 [12-Feb-2024 19:10:24 UTC] PHP Deprecated:  Return type of BatchUpload_Application_DataContainer::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/archive9/archiveiraq.org/plugins/BatchUpload/libraries/BatchUpload/Application/DataContainer.php on line 24

The plugin developer recommended I change public function jsonSerialize() to public function jsonSerialize() : mixed on line 24 of the DataContainer.php file. I haven’t seen the error message since. Now when I try to run a job it just takes me back to step 2 where it asks me to upload a CSV file.

The plugin developer also recommended I upload Job Diagnostics, but that’s not showing me error messages either. It just shows that the job timed out.

And the messages above were retrieved from the .htaccess file.