Unable to delete album

TMacSC

Joined: 2014-03-19
Posts: 10
Posted: Wed, 2014-03-19 22:54

It seems there is an issue in data lengths for different columns in the database. I was having an issue with one of my albums due to (I think now) a very long title. This seems to be confirmed by the fact that I cannot delete said album.

Is there any way to delete this album manually (with a manual query?)

Here's the error that Gallery 3 reported:

Host name: timserve.local
Operating system: Darwin 13.1.0
Apache: Apache/2.2.26 (Unix) DAV/2 PHP/5.4.24 mod_ssl/2.2.26 OpenSSL/0.9.8y
PHP: 5.4.24
MySQL: 5.6.16
Server load: 1.23779296875 1.017578125 0.98583984375
Graphics toolkit: imagemagick
Version: 3.0.9 (Chartres)
Albums: 74
Photos: 1918
Database_Exception [ Database Error ]:
#1406: Data too long for column 'relative_path_cache' at row 1 [ UPDATE `items` SET `relative_path_cache` = 'oregon_2012/Hole-in-the-Ground%20is%20a%20giant%20crater%20left%20behind%20from%20a%20volcanic%20explision_%20We%20would%20have%20explored%20it%20a%20little%20more%2C%20but%20there%20were%20guys%20shooting%20at%20things%20in%20the%20bottom%20of%20the%20crater.jpg', `relative_url_cache` = 'oregon_2012/Hole-in-the-Ground-is-a-giant-crater-left-behind-from-a-volcanic-explision_-We-would-have-explored-it-a-little-more-but-there-were-guys-shooting-at-things-in-the-bottom-of-the-crater' WHERE `id` = '1973' ]
SYSPATH/libraries/Database_Mysqli_Result.php[ 27 ]

22 }
23 elseif (is_bool($result))
24 {
25 if ($result == FALSE)
26 {
27 throw new Database_Exception('#:errno: :error [ :query ]',
28 array(':error' => $link->error,
29 ':query' => $sql,
30 ':errno' => $link->errno));
31 }
32 else
SYSPATH/libraries/Database_Mysqli.php[ 79 ] » Database_Mysqli_Result_Core->__construct( arguments )

SYSPATH/libraries/Database.php[ 272 ] » Database_Mysqli_Core->query_execute( arguments )

MODPATH/gallery/libraries/MY_Database.php[ 48 ] » Database_Core->query( arguments )

SYSPATH/libraries/Database_Builder.php[ 973 ] » Database->query( arguments )

SYSPATH/libraries/ORM.php[ 804 ] » Database_Builder_Core->execute( arguments )

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[ 305 ] » Item_Model_Core->save()

MODPATH/gallery/models/item.php[ 170 ] » Item_Model_Core->relative_path()

MODPATH/gallery/models/item.php[ 94 ] » Item_Model_Core->file_path()

MODPATH/gallery/libraries/ORM_MPTT.php[ 96 ] » Item_Model_Core->delete()

MODPATH/gallery/models/item.php[ 98 ] » ORM_MPTT_Core->delete()

MODPATH/gallery/controllers/quick.php[ 104 ] » Item_Model_Core->delete()

{PHP internal call} » Quick_Controller->delete( 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 )

 
TMacSC

Joined: 2014-03-19
Posts: 10
Posted: Wed, 2014-03-19 23:59

I was able to delete the album by manually changing the name in the items table to something shorter. This condition should probably be checked for, though.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2014-03-20 02:57

Not sure how you added the title but glag you got it sorted.
I think there is a UI limit that it imposed durring album creation and edit.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
TMacSC

Joined: 2014-03-19
Posts: 10
Posted: Thu, 2014-03-20 18:37

I used the Aperture Export plugin, which uses the REST module to insert images. At the database level, having title, relative_path_cache, and relative_url_cache all be varchar(255) is dangerous, since the URL encoding makes the string longer. Maybe the REST module should be updated to handle this case?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2014-03-21 20:06

I have never used it. Your welcome to fix it and submit your changes.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team