Tags not working

Hi,

When trying to tag an item, I get the following error:

2015-02-12T14:07:52+00:00 ERR (3): exception 'Zend_Db_Statement_Mysqli_Exception' with message 'Mysqli statement execute error : Column 'time' cannot be null' in /var/www/omeka/application/libraries/Zend/Db/Statement/Mysqli.php:214
Stack trace:
#0 /var/www/omeka/application/libraries/Zend/Db/Statement.php(303): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /var/www/omeka/application/libraries/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#2 [internal function]: Zend_Db_Adapter_Abstract->query('INSERT INTO `om...', Array)
#3 /var/www/omeka/application/libraries/Omeka/Db.php(79): call_user_func_array(Array, Array)
#4 /var/www/omeka/application/libraries/Omeka/Db.php(252): Omeka_Db->__call('query', Array)
#5 /var/www/omeka/application/libraries/Omeka/Db.php(252): Omeka_Db->query('INSERT INTO `om...', Array)
#6 /var/www/omeka/application/libraries/Omeka/Record/AbstractRecord.php(543): Omeka_Db->insert('RecordsTags', Array)
#7 /var/www/omeka/application/models/Mixin/Tag.php(53): Omeka_Record_AbstractRecord->save()
#8 [internal function]: Mixin_Tag->afterSave(Array)
#9 /var/www/omeka/application/libraries/Omeka/Record/AbstractRecord.php(251): call_user_func_array(Array, Array)
#10 /var/www/omeka/application/libraries/Omeka/Record/AbstractRecord.php(280): Omeka_Record_AbstractRecord->delegateToMixins('afterSave', Array, true)
#11 /var/www/omeka/application/libraries/Omeka/Record/AbstractRecord.php(550): Omeka_Record_AbstractRecord->runCallbacks('afterSave', Array)
#12 /var/www/omeka/application/libraries/Omeka/Controller/AbstractActionController.php(209): Omeka_Record_AbstractRecord->save(false)
#13 /var/www/omeka/application/controllers/ItemsController.php(89): Omeka_Controller_AbstractActionController->editAction()
#14 /var/www/omeka/application/libraries/Zend/Controller/Action.php(516): ItemsController->editAction()
#15 /var/www/omeka/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('editAction')
#16 /var/www/omeka/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#17 /var/www/omeka/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(101): Zend_Controller_Front->dispatch()
#18 /var/www/omeka/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#19 /var/www/omeka/application/libraries/Omeka/Application.php(79): Zend_Application->run()
#20 /var/www/omeka/admin/index.php(28): Omeka_Application->run()
#21 {main}

I'm using php5, mysql and nginx on an Ubuntu 14.04 server. Versions are as follows:

Omeka 2.2.2

Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

nginx version: nginx/1.4.6 (Ubuntu)

php5-mysql (which I understand provides mysqli now) is installed.

Any ideas what I can do to fix this? I found a link which suggested setting the location of php in the config.ini file, which I've done, but no luck.

Thanks in advance.

Cheers,

Matt

I did test to see if this is an nginx issue, buy installing and running the site under apache and that didn't work.

That's odd. Can you save items without a tag? And does it happen no matter what the tag is?

The error makes it look like the time data is not being set before the tag record is saved. It's odd because tags use the same mechanism as items and other records to set timestamp data before saving, so if it is generally not working for tags, I'd expect it to fail elsewhere.

Yes, it's just adding the tag. I've tried a number of different names for tags, so yeah, it doesn't matter what it is.

I've just added a test item and that comes up fine:

http://omeka.okfn.org/items/show/44

The moment I add a tag, I get that error in the logs.

My next guess might be that one of the plugins is behaving badly. Maybe try deactivating all the plugins to see if that lets you add a tag. If so, reactivate one by one to find the culprit.

This is a known issue with newer MySQL servers. It's fixed in the current development code of Omeka, but not in any currently-released version.

The fix should appear in Omeka 2.3, which is forthcoming.

We'd kind of like to have our Omeka site live over the next few weeks, so what are our options here? Move to the dev version? How forthcoming is the new version? Weeks? Or longer?

The release should be soon, but I'm hesitant to stick a firm date on it.

If you're comfortable doing a hotfix to your current version, the fix is very small, and available on GitHub.

I added the hotfix in and that worked. Thanks for the help.