Mysqli execution error accompanied by stack trace

Hello all,

We are trying to get the most recent Omeka release up and running. We are
seeing a Mysqli execution error accompanied by a stack trace. Details follow.

We are running Omeka v1.5.3 with the Scripto, Openlayers and plugins,
along with MediaWiki 1.19.2 (required by Scripto). Our platform is a VMware
guest running 32-bit CentOS 6.3, 2GB main memory, 140GB disk space available.
Our server software is Apache web server 2.2.15, PHP 5.3.3, with access to a
MySQL 5.1 database server hosted on another system.

All of this is new installation, no new collections have been set up yet.

My librarian was trying to do the following operation, which I have been able
to replicate:

- logged in to the Omeka Admin panel with Omeka superuser account;
- chose Scripto from the top menu within Omeka Site (no collection specified);
- MediaWiki login required before user could proceed (MediaWiki superuser);
- went to "Items" on the top menu and clicked "Add an item";
- lefthand menu pops up;
- clicking the "Add Item" button from there produces the error;
- stepped backward to return to the lefthand menu;
- chose "Files," browsed to find the file I wanted to add (a PDF file);
- clicked the green "Add Item" button underneath it;
- same error message appeared again.

Here is the error the user saw... "Omeka has encountered an error
Zend_Db_Statement_Mysqli_Exception Mysqli statement execute error :
Incorrect integer value: '' for column 'item_type_id' at row 1"

...followed by a stack trace...

#0 /var/www/html/omeka/application/libraries/Zend/Db/Statement.php(300): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /var/www/html/omeka/application/libraries/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 [internal function]: Zend_Db_Adapter_Abstract->query('? INSERT...', Array)
#3 /var/www/html/omeka/application/libraries/Omeka/Db.php(83): call_user_func_array(Array, Array)
#4 /var/www/html/omeka/application/libraries/Omeka/Db.php(297): Omeka_Db->__call('query', Array)
#5 /var/www/html/omeka/application/libraries/Omeka/Db.php(297): Omeka_Db->query('? INSERT...', Array)
#6 /var/www/html/omeka/application/libraries/Omeka/Db.php(267): Omeka_Db->exec('? INSERT...', Array)
#7 /var/www/html/omeka/application/libraries/Omeka/Record.php(551): Omeka_Db->insert('Item', Array)
#8 /var/www/html/omeka/application/libraries/Omeka/Record.php(807): Omeka_Record->save()
#9 /var/www/html/omeka/application/libraries/Omeka/Controller/Action.php(419): Omeka_Record->saveForm(Array)
#10 /var/www/html/omeka/application/controllers/ItemsController.php(133): Omeka_Controller_Action->addAction()
#11 /var/www/html/omeka/application/libraries/Zend/Controller/Action.php(516): ItemsController->addAction()
#12 /var/www/html/omeka/application/libraries/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('addAction')
#13 /var/www/html/omeka/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#14 /var/www/html/omeka/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#15 /var/www/html/omeka/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#16 /var/www/html/omeka/application/libraries/Omeka/Core.php(165): Zend_Application->run()
#17 /var/www/html/omeka/admin/index.php(44): Omeka_Core->run()
#18 {main}

I have the PDF file my librarian wanted to add, and can supply phpinfo.
For example, I can say that our Apache/PHP setup recognizes MySQL, Mysqli,
PDO, and PDO_MySQL support.

Could we please get some advice on this issue? Thank you very much!

-- Calvin Miracle, University of Louisville Libraries

Do you know, or can you find out, if your MySQL server is using a strict mode?

On its face, this looks like it might be a strict-mode-related error.

Hi John,

I found the following lines in the database server's my.ini file:

# Set the SQL mode to strict

According to the MySQL Reference manual:

"You can change the SQL mode at runtime by using a SET [GLOBAL|SESSION] sql_mode='modes' statement to set the sql_mode system value. Setting the GLOBAL variable requires the SUPER privilege and affects the operation of all clients that connect from that time on. Setting the SESSION variable affects only the current client. Any client can change its own session sql_mode value at any time. "


-- Calvin Miracle, University of Louisville Libraries