[SOLVED] Unable to delete photo

battledingo
battledingo's picture

Joined: 2006-08-25
Posts: 39
Posted: Mon, 2013-07-01 15:17

Hi

I can't seem to delete a photo album from my gallery. I can delete other photos, this one photo just wont go away.

I have tried:

+ Disabling Imagemagik & Url rewrite
+ Optimized the database
+ Deleted the template cache
+ Deleted the database cache
+ rebuilt all thumbnails/resizes
+ Deleted & reinstalled the modules core folder & main.php from a backup.

Also tried chmod the directory to 777 in cpanel, the album wont go.

I have put the gallery in debug mode & here is the error:

Error (ERROR_PLATFORM_FAILURE)

in modules/core/classes/GalleryDataItem.class at line 222 (GalleryCoreApi::error)
in modules/core/classes/helpers/GalleryEntityHelper_medium.class at line 84 (GalleryDataItem::detachLink)
in modules/core/classes/GalleryCoreApi.class at line 2271 (GalleryEntityHelper_medium::deleteEntityById)
in modules/core/ItemDelete.inc at line 79 (GalleryCoreApi::deleteEntityById)
in main.php at line 231 (ItemDeleteController::handleRequest)
in main.php at line 94
in main.php at line 83

What am I missing? This photo is the walking dead that won't die. Any help would be much appreciated.

Cheers

System Information
Gallery version 2.2.4
PHP version 5.4.16 cgi-fcgi
Webserver Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
Database mysqli 5.5.30-log
Toolkits ImageMagick, Thumbnail
Operating system Linux ld128.inmotionhosting.com 2.6.32-358.6.2.el6.bl1.0.1_1.x86_64 #1 SMP Thu May 30 20:45:26 MDT 2013 x86_64
Browser Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2013-07-01 17:53
Quote:
in modules/core/classes/helpers/GalleryEntityHelper_medium.class at line 84 (GalleryDataItem::detachLink)

was there a link item in this album? can you delete that first?
LinkItem module must be installed/active

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
battledingo
battledingo's picture

Joined: 2006-08-25
Posts: 39
Posted: Tue, 2013-07-02 10:29

Hi Suprsidr

Thanks for your fast reply. In answer to your questions:

1. There is no link item in this item that I know of (I dont use link item).
2. Did you want me to delete line 84 in Helper_medium.class? The line is:

Quote:
$ret = $linkedEntities[0]->detachLink();

3. Linkitem is installed & active.

Do you think reinstalling gallery might fix the locked photo?

cheers

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2013-07-02 11:40
Quote:
Did you want me to delete line 84 in Helper_medium.class?

NO

The "locked photo" might be a symbolically linked item, and gallery may not have permission to delete that item in the filesystem.

If you know which photo it is, try deleting or moving it separately.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
battledingo
battledingo's picture

Joined: 2006-08-25
Posts: 39
Posted: Tue, 2013-07-02 11:55

Hi

I can move the photo and now I can delete the album it is in.

The photo won't delete, it comes up with the same error

Quote:
Error Detail -
Error (ERROR_PLATFORM_FAILURE)

in modules/core/classes/GalleryDataItem.class at line 222 (GalleryCoreApi::error)
in modules/core/classes/helpers/GalleryEntityHelper_medium.class at line 84 (GalleryDataItem::detachLink)
in modules/core/classes/GalleryCoreApi.class at line 2271 (GalleryEntityHelper_medium::deleteEntityById)
in modules/core/ItemDelete.inc at line 79 (GalleryCoreApi::deleteEntityById)
in main.php at line 231 (ItemDeleteController::handleRequest)
in main.php at line 94
in main.php at line 83

I was thinking of upgrading to Gallery ver 2.3 and seeing if that helps. I use gallery checkout (a shopping cart plugin) and it is only compatible to 2.3.

Will let you know how it goes, just backing up my gallery first.

thanks for your help.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2013-07-02 12:02

the cart plugin is compatible w/ 2.3.2

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
battledingo
battledingo's picture

Joined: 2006-08-25
Posts: 39
Posted: Tue, 2013-07-02 12:17

cool, downloading it now. if anyone is looking for gallery 2.3.2 get it from here

:)

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2013-07-02 12:29

Or from the download link in the upper right corner of this site ;)
http://codex.galleryproject.org/Gallery2:Download#Packages

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Tue, 2013-07-02 21:57

Updating is good and should be done but this may be a bug in G2 (except if you had been manually messing about with the filesystem in g2data or with the db.

Not looked at the code in detail but it seems you may have this issue if the parent item has been deleted before trying to delete the linked item.

Can't imagine that this would not have been caught during development but it is theoretically possible.

You should be able to get around this by temporarily editing your modules/core/classes/GalleryDataItem.class at Line 221 from

	if (!$platform->copy($sourcePath, $newPath)) {
	    return GalleryCoreApi::error(ERROR_PLATFORM_FAILURE);
	}

to

	if (!$platform->copy($sourcePath, $newPath)) {
	    return null;
	}

Restore things after deleting the errant file and do update to v2.3.2

--
dakanji.com

 
battledingo
battledingo's picture

Joined: 2006-08-25
Posts: 39
Posted: Tue, 2013-07-02 23:03

Dayo it worked, you are a legend!! Changed the code and the file deleted just like that.

Also found that my error log was 1.5 terabytes so I deleted that parasite.

Thanks Dayo and Suprsidr for your help & quick replies.

Love your work.

:)

 
danielwerner

Joined: 2013-07-21
Posts: 1
Posted: Sun, 2013-07-21 20:22

Thanks alot, that solved everything for me too! :)