Error in add items for version 2.1.4

Dear all,

I've found this problem with my omeka.
Anytime I try to add an item (http://mywebsite/admin/items/add), I receive this error:

Zend_Measure_Exception

No localized value in 32 found, or the given number does not match the localized format

#0 /home/mode/public_omeka/application/libraries/Zend/Measure/Abstract.php(99): Zend_Measure_Abstract->setValue('32', 'MEGABYTE', 'en_US')
#1 /home/mode/public_omeka/application/views/helpers/MaxFileSize.php(82): Zend_Measure_Abstract->__construct('32', 'MEGABYTE')
#2 /home/mode/public_omeka/application/views/helpers/MaxFileSize.php(28): Omeka_View_Helper_MaxFileSize->_getSizeMeasure('32M')
#3 /home/mode/public_omeka/application/libraries/globals.php(1361): Omeka_View_Helper_MaxFileSize->__construct()
#4 /home/mode/public_omeka/admin/themes/default/items/files-form.php(23): max_file_size()
#5 /home/mode/public_omeka/admin/themes/default/items/form-tabs.php(29): require('/home/mode/publ...')
#6 /home/mode/public_omeka/admin/themes/default/items/add.php(4): include('/home/mode/publ...')
#7 /home/mode/public_omeka/application/libraries/Omeka/View.php(117): include('/home/mode/publ...')
#8 /home/mode/public_omeka/application/libraries/Zend/View/Abstract.php(888): Omeka_View->_run('/home/mode/publ...')
#9 /home/mode/public_omeka/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(900): Zend_View_Abstract->render('items/add.php')
#10 /home/mode/public_omeka/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(921): Zend_Controller_Action_Helper_ViewRenderer->renderScript('items/add.php', NULL)
#11 /home/mode/public_omeka/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(960): Zend_Controller_Action_Helper_ViewRenderer->render()
#12 /home/mode/public_omeka/application/libraries/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#13 /home/mode/public_omeka/application/libraries/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#14 /home/mode/public_omeka/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('addAction')
#15 /home/mode/public_omeka/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#16 /home/mode/public_omeka/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#17 /home/mode/public_omeka/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#18 /home/mode/public_omeka/application/libraries/Omeka/Application.php(79): Zend_Application->run()
#19 /home/mode/public_omeka/admin/index.php(28): Omeka_Application->run()
#20 {main}

I search in forum with no results.

Did anyone mets this problem?

Thanks in advance

Someone else has reported the same issue on our dev list, it seems.

Are you using a language other than the default?

I see a reference to en_US in your traceback, so I guess you didn't have a different locale set.

Are there any errors in your PHP log? (If you don't know where that is, a good place to look is your Apache error log.) In particular, errors referencing XML or simplexml may be relevant.

Yes, I didn' t have a locale. I found this errors in my apache log:

PHP Warning: simplexml_load_file(): I/O warning : failed to load external entity "/home/mode/public_omeka/application/libraries/Zend/Locale/Data/root.xml" in /home/mode/public_omeka/application/libraries/Zend/Locale/Data.php on line 161,

I've thinked that it is related to permissions on file or folder but it seems ok.

I've notice that in Items page there isn't value in items table for column "Date Added" or sometime appears this error:

Warning: simplexml_load_file(): I/O warning : failed to load external entity "/home/mode/public_omeka/application/libraries/Zend/Locale/Data/en_US.xml" in /home/mode/public_omeka/application/libraries/Zend/Locale/Data.php on line 161
.

Omeka run on Debian with Apache 2.22 PHP 5.4.4 Mysql 5.5

Any ideas?

Many thanks

Yes, there's some problem happening where the locale data isn't readable.

Permissions is definitely the first thing that comes to mind. You say you checked the permissions on that specific file and folder listed in the error, and they're fine? Do you have SELinux or some other nonstandard permissions set, maybe? What does ls -l show for the root.xml file?

Hi John,

about permission, I haven't modify anything after first installation.

All the files are under the properties of an user of my system.

I don't have SELINUX. I'm monitoring omeka folder with auditd daemon.

I've checked root.xml permissions:

92K -rwxrwxrwx 1 mode mode 90K Jun 12 11:27 root.xml

I have set 777 permissions over this file.

As you can see "mode" is the user under omeka platform "run".

Many thanks for your help, I don't have any idea about this problem and my knowledge of Zend is very limited.

Hi,

I've found this bug in PHP related to function simplexml_load_file:

https://bugs.php.net/bug.php?id=62577

I'm trying to change simplexml_load_file with simplexml_load_string in Data.php.

I also empty cache in tmp folder.

I hope this is the right way to solve my problem.

Many thanks to all.

Best regards

Can you post your System Information output (it's linked from the bottom-right of the admin).

The newer version of Zend Framework we're using in the current development version (which will soon be released as version 2.2) removes that simplexml_load_file call. Part of what they do instead looks like its a workaround for the bug you linked.

So, hopefully, version 2.2 will fix this issue.

Omeka 2.1.4
PHP 5.4.4-14+deb7u11 (apache2handler)
OS Linux 3.2.0-4-686-pae i686
MySQL Server 5.5.37
MySQL Client 5.5.37
Apache Apache
PHP Extensions
Regular apache2handler, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, Phar, posix, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, zip, zlib
Plugins
Commenting 2.1
DublinCoreExtended 2.0.1
ExhibitBuilder 2.1.2
ItemRelations 2.0.1
NeatlineTime 2.0.3
SimplePages 2.1.1
SocialBookmarking 2.0.1
Themes
Berlin 2.1.3
Seasons 2.1.6 (current)
Thanks, Roy 2.1.1

Hi John,

now it seems work well without errors in apache log.

All my users can add items without problems.

My next step is to activate language localization.

Thanks for your help

Did you make some change that made it work?

Yes, I change simplexml_load_file with simplexml_load_string in application/libraries/Zend/Locale/Data.php

Ah, okay. Thanks for the update.

I believe that Omeka 2.2 will solve this problem for you as well.

Ok, I'll wait for Omeka 2.2.

Many thanks