Orphans and Duplicate Albums Revisited

jeffhare

Joined: 2007-09-21
Posts: 5
Posted: Thu, 2008-01-24 16:45

The following information is required to get an answer:
Get this information from the PHP diagnostic (in the configuration wizard).
Gallery URL (optional but very useful): http://www.catalina320.com/gallery
Gallery version: 1.5.7
Apache version: 2.0.61
PHP version (don't just say PHP 4, please): php 5.2.3
Graphics Toolkit: imagemagic
Operating system: Linux
Web browser/version (if applicable): any

Hello,

I've read every topic I could find here regarding Duplicate entries and Orphans.

I started my gallery way back at 1.3 or earlier. Most of the albums were created and added to over time, rarely were they relocated via the gallery "move" operation.

It *appears* that there is a bug with moving nested albums around with some combination of "renaming" the albums via the gallery rename album menu option.

Here's what I did:
* I used the very helpful php-deserialize script to get a better understanding of the album.dat and albumdb.dat.
* What I found was that several Child Albums still referred to the Parent Album's OLD name, even after the child album was moved to top level. This resulted in FindOrphans thinking that these albums were orphans even when they appear at the gallery root.
* I tried all the various combinations of moving stuff around, renaming, overwriting directories, etc. that were mentioned in various posts, without real success.
* EMACS to the rescue. I went in and edited the album.dat file for each album that showed that it was an orphan and changed the s:15:"parentAlbumName";s:16:"TheMissingParent"; to s:15:"parentAlbumName";i:0; (where "TheMissingParent" were names of albums that were renamed within gallery at some point.)
* VIOLA! They vanished from the Orphans list and I was able to successfully move them down into some child album properly.

NOTE: I had previously taken great tedious pains to move all the photos in duplicated albums to brand new root albums and then delete the duplicates. To Delete Duplicate Album references, I had to first make a copy of the album. Then delete one instance of it. Then restore the copy and delete the second instance. Otherwise, I'd get a error when viewing the parent album when it was trying to render the album entry the "duplicated" item. These instances were created by the "FindOrphans" process of reattaching.

This has been a big problem since I've been reorganizing some albums (using only Gallery GUI commands) and I don't yet know what circumstances cause this to happen. But I do know for sure that it can be reproduced using Gallery operations from the GUI without touching the file system.

I suspect, but don't know for sure, that if you have nested albums and rename a parent, the chain of events might start.

If anyone has more information to add here, I'm sure lots of G1 people will really appreciate tracking this down and solving it once and for all!

Look forward to working towards a solution. I'm just not sure which code I ought to look at first (and my time is very limited).

 
xinca
xinca's picture

Joined: 2002-09-28
Posts: 86
Posted: Fri, 2008-03-07 16:13

I just ran into this duplicate album issue today. May be I can cite the process of what I have done, so the G1 team can try replicating the problem and find a fix.

I created a few nested albums yesterday and loaded with photos. Today I found I used incorrect naming policy as I went to rename BOTH URL and album title. Things moved on as normal until the 3rd or 4th folders when I went away the desk for lunch.

Forgotten exactly where I stopped when return desk, so I just resumed renaming for the page I left on screen. Bump! An error message saying album already exists. I went to the "find orphan" page in hope to get things fixed... found 12 orphans... not sure why there were so many orphans... 10 of them were sub-albums I have not touched for weeks... but I just went ahead to press the proceed button. Checked "validate album" link, no error found.

Until then I didn't realized the orphan fixing method is to move all orphans to root... and see error messages here and there as the other threads described in details.

One problem I see which is not mentioned by other thread, that is the gallery pages loading time has becoming significantly slower then before.

I really need a fix ASAP, or my client will be fixing me... : (

I am on v1.5.7 standalone, linux PHP Version 4.4.4, MySQl Apache 1.3.39.

C How
---
Sponsor: SyncEXP - Synchronizes data ( files & ODBC records ) between any storage drives < http://syncexp.com/ >