[tags] Edit/renaming/merging tags

caddymob
caddymob's picture

Joined: 2007-01-30
Posts: 82
Posted: Sun, 2008-07-13 10:28

Tried to rename some tags and found that I can't name a tag if there is already a tag with that name...

The reason I want to do this is clean up my tags and fix some errors... For example, I have a tag Dark1 and I want it just Dark. Only problem is there is already a tag Dark.

Is it possible to fix tags like this? In otherwords, merge one tag name into another? Here is the error output:

Quote:
Error (ERROR_STORAGE_FAILURE)

* in modules/core/classes/GalleryStorage.class at line 718 (GalleryCoreApi::error)
* in modules/core/classes/GalleryCoreApi.class at line 2885 (GalleryStorage::updateMapEntry)
* in modules/tags/classes/TagsHelper.class at line 342 (GalleryCoreApi::updateMapEntry)
* in modules/tags/AdminTags.inc at line 70 (TagsHelper::renameTag)
* in main.php at line 249 (AdminTagsController::handleRequest)
* in main.php at line 103
* in main.php at line 88

---and---

Quote:
Query: UPDATE g2_TagMap SET g_tagName='Dark' WHERE g_tagName='Dark1' failed. Duplicate entry 'Dark' for key 2
1062: Duplicate entry 'Dark' for key 2

ADOConnection._Execute(UPDATE g2_TagMap SET
g_tagName='Dark' WHERE g_tagName='Dark1') % line 872, file: adodb.inc.php
ADOConnection.Execute(UPDATE g2_TagMap SET g_tagName=? WHERE
g_tagName=?, Array[2]) % line 715,
file: GalleryStorage.class
GalleryStorage.updateMapEntry(TagMap, Array[1], Array[1],
false) % line 2885, file: GalleryCoreApi.class
GalleryCoreApi.updateMapEntry(TagMap, Array[1],
Array[1]) % line 342, file: TagsHelper.class

Thanks!

 
caddymob
caddymob's picture

Joined: 2007-01-30
Posts: 82
Posted: Tue, 2008-07-29 08:07

& bump! Any ideas? Really need to get in there and do some house cleaning... Just tried again --

Error (ERROR_STORAGE_FAILURE)

* in modules/core/classes/GalleryStorage.class at line 718 (GalleryCoreApi::error)
* in modules/core/classes/GalleryCoreApi.class at line 2885 (GalleryStorage::updateMapEntry)
* in modules/tags/classes/TagsHelper.class at line 342 (GalleryCoreApi::updateMapEntry)
* in modules/tags/AdminTags.inc at line 70 (TagsHelper::renameTag)
* in main.php at line 249 (AdminTagsController::handleRequest)
* in main.php at line 103
* in main.php at line 88

System Information
Gallery version 2.3-svn
PHP version 5.2.6 cgi-fcgi
Webserver Apache/2.2.9 (Unix) PHP/4.4.7 mod_ssl/2.2.9 OpenSSL/0.9.8c mod_fastcgi/2.4.6 DAV/2 SVN/1.4.2
Database mysqli 5.0.45-log
Toolkits ImageMagick, NetPBM, Gd
Operating system Linux dillinger 2.6.24.6-p4-modules-peon-grsec #1 SMP Thu May 15 22:08:43 PDT 2008 x86_64
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16

_______________________________________

Highly Dynamic Photography | Jason Corneveaux

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2008-07-29 09:55

No, the tags modules doesn't allow this. You can do it with some custom sql commands that you can run in PHPMyAdmin though.

 
caddymob
caddymob's picture

Joined: 2007-01-30
Posts: 82
Posted: Tue, 2008-07-29 18:24

I was afraid of that... So, hope this isn't too much of a dunce question, but what would the sql comands be on my example of Dark1 --> Dark

 
caddymob
caddymob's picture

Joined: 2007-01-30
Posts: 82
Posted: Wed, 2008-09-03 04:55

Guys, I am really at a loss here... I need to clean up the tags on my site and I just keep going in circles.

I thought I'd try to replace the images in my gallery with bad tags -- i just uploaded over the .jpgs in /gallery2/g2data/albums

The old tags are still showing up!! They are definitely gone, checked and double checked in exiftool... I even deleted the tag module and reinstalled, but somehow the OLD EXIF data is still buried somewhere.

For example, I cleaned up the tags in this album and loaded the 'clean' jpgs in the g2data/albums:

http://corneveaux.com/gallery2/v/xmas2007/white/

But, the old crappy tags are still showing up! Like this useless tag:

http://corneveaux.com/gallery2/main.php?g2_view=tags.VirtualAlbum&g2_tagName=8.64++Km+to+Cochran++in+Arizona+United+States

PLEASE!! How can I fix this? I have hundreds of photos, and 1 by 1 reupload just wont work...

Quote:
Gallery version = 2.3-svn core 1.2.35 r17681
API = Core 7.53, Module 3.9, Theme 2.6, Embed 1.4
PHP version = 5.2.6 cgi-fcgi
Webserver = Apache/2.2.9 (Unix) PHP/4.4.7 mod_ssl/2.2.9 OpenSSL/0.9.8c mod_fastcgi/2.4.6 DAV/2 SVN/1.4.2
Database = mysqli 5.0.67-log, lock.system=flock
Toolkits = Exif, Gd, ImageMagick, NetPBM, LinkItemToolkit, Ffmpeg, Thumbnail
Acceleration = none/900, none/900
Operating system = Linux dillinger 2.6.24.5-serf-xeon-c6.1-grsec #2 SMP Fri Aug 1 14:00:32 PDT 2008 x86_64
Default theme = carbon
gettext = enabled
Locale = en_US