Album Rename issue: The name you entered is already in use

klinsinow

Joined: 2005-02-28
Posts: 4
Posted: Sun, 2012-04-22 17:17

I am having an issue with renaming an existing album to the same (no longer used) name of another album.

I renamed a sub album with items in it from "naomi" to a different name because I wanted to use that name elsewhere. Then I tried creating a new root level album with name of "naomi" and gallery automatically changed it to "naomi_001". When I try to rename it to "naomi", the following error appears:

The name you entered is already in use. Please choose another.

I checked the album folder on the server and noticed that there was an empty folder called "naomi". I probably shouldn't have, however I did delete it, and that did not change anything. I realize there is probably a database entry someplace that still contains "naomi" as an album name even though it no longer physically exists.

I have cleared both template cache and database cache, optimized database, and run an integrity check.

I turned on debug and have attached the debug history that came up during the process of trying to rename the album.

Below is all my configuration information.

Is this a bug with 2.3 or is there something else I can or should have done?

Thanks!

Jeff

Gallery URL = http://www.jeffsphotojournal.com/gallery/main.php
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.17 cgi-fcgi
Webserver = Apache
Database = mysqli 5.1.61-community-log, lock.system=database
Toolkits = LinkItemToolkit, Thumbnail, ImageMagick, jpegtran, Getid3, ArchiveUpload, Exif, NetPBM
Acceleration = none, none
Operating system = Linux box651.bluehost.com 2.6.32-20120131.55.1.bh6.x86_64 #1 SMP Tue Jan 31 15:43:27 EST 2012 x86_64
Default theme = classic
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Rows in GalleryAccessMap table = 266
Rows in GalleryAccessSubscriberMap table = 11166
Rows in GalleryUser table = 14
Rows in GalleryItem table = 11164
Rows in GalleryAlbumItem table = 191
Rows in GalleryCacheMap table = 0

AttachmentSize
Website Debug Output.txt20.18 KB
 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2012-04-22 17:56
klinsinow wrote:
Is this a bug with 2.3 or is there something else I can or should have done?

No. It is not a bug with G2. You are not supposed to interact with any G2 files or folders directly.

When you want to add a file, you have to add it from within G2. You should not go into the g2data folder and add it directly there.
When you want to create a folder, you have to create it from within G2. You should not go into the g2data folder and create it directly there.
When you want to delete a file, you have to delete it from within G2. You should not go into the g2data folder and delete it directly there.
When you want to create a folder, you have to delete it from within G2. You should not go into the g2data folder and delete it directly there.

Why? Well, there are several database entries that need to be changed and the G2 script does this as part of the adding/deleting/editing process. This is why there are button/links to add/delete/edit items in the G2 interface. The G2 devs would not have wasted their time writing thousands of lines of code to do all those things if doing it directly on the filesystem was an option.

Going into the filesystem can do the physical edit but leaves the database edit out. Refreshing caches is not the same thing. In simple terms, your problem is because you decided to muck about with the filesystem directly which leaves orphaned entries in the database.

To get around it, reverse what you did wrongly and then do it correctly.
1. Go into the filesystem where the folder was before and recreate it manually in the same location the folder was before. You can leave it empty.
2. Log into G2 and delete the album from within G2.

This will still leave you with orphaned items in the database as the entries for the contents of the album will still be in the database potentially causing problems later.

One of the members here has a script that can help search for such orphaned items. They may post a link to this here.

Moral of the story, use the tool (G2) as it was designed to be used.

Good luck!

--
dakanji.com

 
klinsinow

Joined: 2005-02-28
Posts: 4
Posted: Sun, 2012-04-22 21:38

I never interfaced with the folders prior to having the issue. I know better than that :). I do all my interaction through G2s interface. I only looked at and noticed the empty album folder after the renaming did not work. Pretty much ignore the fact that I mentioned going to the folder structure as that was done after the issue.

Update:
Not sure what happened (possibly user error), however I noticed that there was a top level album on the second page which had the same name as the one I was trying to rename to "naomi". There was no content and there was also no top level folder within Album folders with the name, so I didn't see when browsing the folder structure. Most of my top level albums are on first page, so that's why I missed the empty album on second page. Now it works!