Need help reading/understanding error from log file

Hi,

Omeka is logging to file on my server and I'm getting the following trace error but I have no idea how to read it. Can someone do it for me or point me to somewhere so that I can learn to read it.

Warm Regards
Mike.

2016-02-24T16:24:40+00:00 ERR (3): exception 'InvalidArgumentException' with message 'Invalid record passed to recordMetadata.' in /data/www/html/repo24/application/views/helpers/AllElementTexts.php:89
Stack trace:
#0 [internal function]: Omeka_View_Helper_AllElementTexts->allElementTexts(NULL, Array)
#1 /data/www/html/repo24/application/libraries/Zend/View/Abstract.php(350): call_user_func_array(Array, Array)
#2 /data/www/html/repo24/application/libraries/globals.php(2048): Zend_View_Abstract->__call('allElementTexts', Array)
#3 /data/www/html/repo24/application/libraries/globals.php(2048): Omeka_View->allElementTexts(NULL, Array)
#4 /data/www/html/repo24/themes/accounts/items/show.php(1019): all_element_texts(NULL)
#5 /data/www/html/repo24/application/libraries/Omeka/View.php(117): include('/data/www/html/...')
#6 /data/www/html/repo24/application/libraries/Zend/View/Abstract.php(888): Omeka_View->_run('/data/www/html/...')
#7 /data/www/html/repo24/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(912): Zend_View_Abstract->render('items/show.php')
#8 /data/www/html/repo24/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(933): Zend_Controller_Action_Helper_ViewRenderer->renderScript('items/show.php', NULL)
#9 /data/www/html/repo24/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(972): Zend_Controller_Action_Helper_ViewRenderer->render()
#10 /data/www/html/repo24/application/libraries/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#11 /data/www/html/repo24/application/libraries/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#12 /data/www/html/repo24/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('showAction')
#13 /data/www/html/repo24/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#14 /data/www/html/repo24/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#15 /data/www/html/repo24/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#16 /data/www/html/repo24/application/libraries/Omeka/Application.php(79): Zend_Application->run()
#17 /data/www/html/repo24/index.php(23): Omeka_Application->run()
#18 {main}

The error at the top tells where PHP encountered something that made it break. In this case, in the file application/views/helpers/AllElementTexts.php on line 89, in the function recordMetadata(). It's expecting one kind of data to be passed as an argument, but not getting it.

That doesn't necessarily say where the ultimate problem is, just where the problem got to be too much for PHP to deal with.

That's where the trace comes in. Each line give the php file and line the program ran through. Almost always, ignore things in Zend, and instead look for lines in Omeka, especially themes and plugins.

Here, the suspicious line looks like the one for themes/accounts/items/show.php, where it called the all_element_texts() global function. As you'd expect, that leads toward the big error at the top.

That looks like you have a custom theme called "accounts", and there's a problem in its items/show.php file where it calls that function. Probably it isn't passing the $item record to the all_element_texts() function.

Here's what it looks like in other themes:

<?php echo all_element_texts('item'); ?>

If that's what you have, that means something more complex is happening and the item isn't being set for the page.

Hope that helps
Patrick

Hi Patrick,

The call is fine in show.php. Must be a problem with either ItemRelations or some collections/items have been deleted. I'm unable to replicate as I don't know what URL was but I do know that I have no items with the number 1019?

I have looked at the Apache error and access log files to see if there are any lines with the same time-stamp as the Omeka error.log but no joy there.

I'll have to wait until I come across the error myself and then chase it.

Warm Regards
Mike.

The 1019 number doesn't refer to the item id, but to the line in the show.php file. (which seems unusually big for that file, but ya never know)

It might be worth putting a debug() message in that file, that would show the item ID in the log, just to see what item(s) throw this exception. If you do that, make sure that the settings in config.ini will log to that level.

I'm learning.. ok... have chased up debug() but can't find any examples. Do I pass a quoted string or variables? or just debug()?

Mike.

The argument should be some text that you want to show up in the log file. For example,

debug($item->id);

to show item ids. Doing that, and looking for it before or after the same error and trace, might help you track down whether this happens for all items, or just specific ones.

Brilliant... all sorted!... privacy issues between collections and items!!... Guinness waiting for you!

Warm Regards
Mike.