Gallery broken / ORM Validation

Jlma

Joined: 2014-01-29
Posts: 3
Posted: Wed, 2014-01-29 18:46

Hi,

I have been running Gallery for some years but today I run into a problem I cannot resolve by myself.

I added Theme Dispatcher-module and imobile theme to my gallery to please some mobile users. So far so good, however I noticed that mobile theme shows thumbnails incorrectly, so I added square thumbnail module and started rebuild process. All except one thumbnail were successfully generated and the one would only display ORM Validation has failed-error in logs. Then I tried to run fix my gallery, but this also failed with the same error message. Log-file shows error like this:

Quote:
#0 /usr/share/gallery3/system/libraries/ORM.php(755): ORM_Validation_Exception_Core::handle_validation('items', Object(Validation))
#1 /usr/share/gallery3/modules/gallery/models/item.php(887): ORM_Core->validate(NULL)
#2 /usr/share/gallery3/system/libraries/ORM.php(778): Item_Model_Core->validate()
#3 /usr/share/gallery3/modules/gallery/libraries/MY_ORM.php(34): ORM_Core->save()
#4 /usr/share/gallery3/modules/gallery/libraries/ORM_MPTT.php(79): ORM->save()
#5 /usr/share/gallery3/modules/gallery/models/item.php(533): ORM_MPTT_Core->save()
#6 /usr/share/gallery3/modules/gallery/models/item.php(305): Item_Model_Core->save()
#7 /usr/share/gallery3/modules/gallery/helpers/gallery_task.php(692): Item_Model_Core->relative_path()
#8 [internal function]: gallery_task_Core::fix(Object(Task_Model))
#9 /usr/share/gallery3/modules/gallery/helpers/task.php(90): call_user_func_array('gallery_task::f...', Array)
#10 /usr/share/gallery3/modules/gallery/controllers/admin_maintenance.php(195): task_Core::run('33')
#11 [internal function]: Admin_Maintenance_Controller->run('33')
#12 /usr/share/gallery3/modules/gallery/controllers/admin.php(62): call_user_func_array(Array, Array)
#13 [internal function]: Admin_Controller->__call('maintenance', Array)
#14 /usr/share/gallery3/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Admin_Controller), Array)
#15 [internal function]: Kohana_Core::instance(NULL)
#16 /usr/share/gallery3/system/core/Event.php(208): call_user_func_array(Array, Array)
#17 /usr/share/gallery3/application/Bootstrap.php(67): Event_Core::run('system.execute')
#18 /usr/share/gallery3/index.php(116): require('/usr/share/gall...')
#19 {main}
2014-01-29 18:41:10 +00:00 --- error: Validation errors: Array
(
[slug] => reserved
)

After this no folders are shown on my gallery and no picture can be accessed. If I try it, I get an error message like this:

Quote:
ORM_Validation_Exception [ Database Error ]:
ORM Validation has failed for items model
SYSPATH/libraries/ORM_Validation_Exception.php[ 20 ]

15 * @param Validation $array
16 * @return
17 */
18 public static function handle_validation($table, Validation $array)
19 {
20 $exception = new ORM_Validation_Exception('ORM Validation has failed for :table model',array(':table'=>$table));
21 $exception->validation = $array;
22 throw $exception;
23 }
24} // End ORM_Validation_Exception
SYSPATH/libraries/ORM.php[ 755 ] » ORM_Validation_Exception_Core::handle_validation( arguments )

MODPATH/gallery/models/item.php[ 887 ] » ORM_Core->validate( arguments )

SYSPATH/libraries/ORM.php[ 778 ] » Item_Model_Core->validate()

MODPATH/gallery/libraries/MY_ORM.php[ 34 ] » ORM_Core->save()

MODPATH/gallery/libraries/ORM_MPTT.php[ 79 ] » ORM->save()

MODPATH/gallery/models/item.php[ 533 ] » ORM_MPTT_Core->save()

MODPATH/gallery/models/item.php[ 320 ] » Item_Model_Core->save()

MODPATH/gallery/models/item.php[ 140 ] » Item_Model_Core->relative_url()

MODPATH/gallery/libraries/Breadcrumb.php[ 52 ] » Item_Model_Core->url( arguments )

MODPATH/gallery/controllers/albums.php[ 98 ] » Breadcrumb_Core::array_from_item_parents( arguments )

{PHP internal call} » Albums_Controller::get_display_context( arguments )

MODPATH/gallery/helpers/item.php[ 419 ] » call_user_func_array( arguments )

MODPATH/gallery/controllers/photos.php[ 34 ] » item_Core::get_display_context( arguments )

{PHP internal call} » Photos_Controller->show( arguments )

SYSPATH/core/Kohana.php[ 331 ] » ReflectionMethod->invokeArgs( arguments )

{PHP internal call} » Kohana_Core::instance( arguments )

SYSPATH/core/Event.php[ 208 ] » call_user_func_array( arguments )

APPPATH/Bootstrap.php[ 67 ] » Event_Core::run( arguments )

DOCROOT/index.php[ 116 ] » require( arguments )

My version is 3.0.9, does anyone have an idea how to fix something like this?

 
Jlma

Joined: 2014-01-29
Posts: 3
Posted: Thu, 2014-01-30 10:19

Some additional information... I checked the database and looks like the Fix-function has changed relative_path_cache and relative_url_cache to NULL on one folder, which will hide all folders. I changed them manually and folders are visible again, but if trying to run fix my gallery again, result is the same. Also, thumbnail is missing and I get this in log file when trying to rebuild it:

Quote:
--- error: File not found: var%2Fthumbs%2FUsers%2F.album.jpg%3Fm%3D0

Yet, file .album.jpg is present in file system.

 
Jlma

Joined: 2014-01-29
Posts: 3
Posted: Thu, 2014-01-30 11:30

Finally got it sorted out. I have a folder named "Users", which has worked before. I manually changed the slug value from Users and after that I was able to create thumbnails as before.