Cannot create new keyword

I cannot add new keyword. I have the following error when trying:

Zend_Db_Statement_Mysqli_Exception

    Mysqli statement execute error : Field 'entity_id' doesn't have a default value

Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Field 'entity_id' doesn't have a default value in /omeka/application/libraries/Zend/Db/Statement/Mysqli.php:214
Stack trace:
#0 /omeka/application/libraries/Zend/Db/Statement.php(303): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /omeka/application/libraries/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#2 /omeka/application/libraries/Omeka/Db.php(79): Zend_Db_Adapter_Abstract->query('INSERT INTO `v2...', Array)
#3 /omeka/application/libraries/Omeka/Db.php(255): Omeka_Db->__call('query', Array)
#4 /omeka/application/libraries/Omeka/Record/AbstractRecord.php(541): Omeka_Db->insert('v2_records_tags', Array)
#5 /omeka/application/models/Mixin/Tag.php(52): Omeka_Record_AbstractRecord->save()
#6 /omeka/application/libraries/Omeka/Record/AbstractRecord.php(254): Mixin_Tag->afterSave(Array)
#7 /omeka/application/libraries/Omeka/Record/AbstractRecord.php(283): Omeka_Record_AbstractRecord->delegateToMixins('afterSave', Array, true)
#8 /omeka/application/libraries/Omeka/Record/AbstractRecord.php(548): Omeka_Record_AbstractRecord->runCallbacks('afterSave', Array)
#9 /omeka/application/libraries/Omeka/Controller/AbstractActionController.php(229): Omeka_Record_AbstractRecord->save(false)
#10 /omeka/application/controllers/ItemsController.php(88): Omeka_Controller_AbstractActionController->editAction()
#11 /omeka/application/libraries/Zend/Controller/Action.php(516): ItemsController->editAction()
#12 /omeka/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('editAction')
#13 /omeka/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#14 /omeka/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#15 /omeka/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#16 /omeka/application/libraries/Omeka/Application.php(73): Zend_Application->run()
#17 /omeka/admin/index.php(28): Omeka_Application->run()
#18 {main}

bug still present today.

What version of Omeka is this?

There hasn’t been an entity_id column in the records_tags table for a very long time now.

It is a 2.6 version of Omeka Classic but the content (and keywords) was migrated from an older version 1.x.

That table should only have 5 columns, you can see the correct structure here. Perhaps this is an artifact of a somewhat “manual” upgrade or migration? If you’ve got all the other “correct” columns, you could just drop entity_id since Omeka 2.6 doesn’t use it (and doesn’t save any values there, which is what’s causing this error).

I think the mysql databse was manually upgraded by someone else.

I don’t have a records_tags table but I have an omeka_tags table.

I think I will not use tags if there is no way to recreate securely this table.

The error message you supplied indicated that you should have a table v2_records_tags (I presume your db prefix is set to v2).

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