Piwigo Bugtracker

Viewing Issue Advanced Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000559 [Piwigo] metadata major always 2006.10.11 16:05 2012.02.10 14:57
Reporter dppiseb View Status public  
Assigned To plg
Priority normal Resolution fixed Platform Linux
Status closed   OS RedHat
Projection none   OS Version Fedora Core 4
ETA none Fixed in Version 2.3.3 Product Version 1.6.1
  Target Version 2.3.3 Product Build
Summary 0000559: duplicate insert on tags when synchronizing metadata
Description The following message appears when updating metadata from admin.php?page=site_update&site=1 or admin.php?page=picture_modify :
INSERT INTO phpwebgallery_image_tag
   (image_id,tag_id)
    VALUES
   ('1493','522')
   ,('1493','515')
[...]
   ,('1493','524')
   ,('1493','11')
;
[mysql error 1062] Duplicate entry '1493-408' for key 1

Steps To Reproduce updating metadata from admin.php?page=site_update&site=1 or admin.php?page=picture_modify
Additional Information
Tags No tags attached.
browser Safari
Database engine and version 4.1.11
PHP version 5.0.4
Web server Apache 2.0.54
Attached Files

- Relationships

-  Notes
(0001462)
plg (manager)
2006.10.12 09:28

Quick correction: in admin/include/functions.php, release 1.6.1, line 1805 in set_tags_of function, replace:

foreach ($tag_ids as $tag_id)

by

foreach (array_unique($tag_ids) as $tag_id)


As a reminder for me: apply this modification to the set_tags_of and replace set_tags by set_tags_of everywhere.
(0001465)
dppiseb (reporter)
2006.10.12 13:10

This fixes the main update bug, but now I get a new error message :
INSERT INTO phpwebgallery_tags
  (name,url_name)
   VALUES
  (NULL,NULL)
;
[mysql error 1048] Column 'name' cannot be null
(0001475)
plg (manager)
2006.10.16 23:48

> INSERT INTO phpwebgallery_tags
> (name,url_name)
> VALUES
> (NULL,NULL)
> ;

After a code investigation and some tests, it seems that your IPTC value mapped to tags sometimes contains "foo,,bar". To avoid any "empty" tag, in admin/include/functions_metadata.php, function get_sync_iptc_data, release 1.6.1, line 55, after:

  $iptc['keywords'] = preg_replace('/^,+|,+$/', '', $iptc['keywords']);

insert:

  $iptc['keywords'] = preg_replace('/,+/', ',', $iptc['keywords']);
(0005911)
plg (manager)
2012.01.10 14:00

http://piwigo.org/forum/viewtopic.php?pid=127013#p127013 [^]
(0006015)
svn (reporter)
2012.02.10 14:55

[Subversion] r13080 by plg on branch 2.3

-----[Subversion commit log]----------------------------------------------------
bug 559 fixed: avoid duplicate insert on tags when synchronizing metadata if
the IPTC keywords contains repeated separators like "tag1,,tag2".
(0006016)
svn (reporter)
2012.02.10 14:57

[Subversion] r13081 by plg on trunk

-----[Subversion commit log]----------------------------------------------------
merge r13080 from branch 2.3 to trunk

bug 559 fixed: avoid duplicate insert on tags when synchronizing metadata if
the IPTC keywords contains repeated separators like "tag1,,tag2".


- Issue History
Date Modified Username Field Change
2006.10.11 16:05 dppiseb New Issue
2006.10.11 16:05 dppiseb browser => Safari
2006.10.11 16:05 dppiseb MySQL version => 4.1.11
2006.10.11 16:05 dppiseb PHP version => 5.0.4
2006.10.11 16:05 dppiseb Web server => Apache 2.0.54
2006.10.12 09:28 plg Note Added: 0001462
2006.10.12 09:28 plg Assigned To => plg
2006.10.12 09:28 plg Status new => assigned
2006.10.12 13:10 dppiseb Note Added: 0001465
2006.10.16 23:29 plg Summary MySQL error message when updating metadata => duplicate insert on tags when synchronizing metadata
2006.10.16 23:48 plg Note Added: 0001475
2012.01.10 14:00 plg Note Added: 0005911
2012.01.10 14:00 plg Target Version => 2.3.3
2012.02.10 14:55 svn Checkin
2012.02.10 14:55 svn Note Added: 0006015
2012.02.10 14:57 svn Checkin
2012.02.10 14:57 svn Note Added: 0006016
2012.02.10 14:57 plg Status assigned => closed
2012.02.10 14:57 plg Resolution open => fixed
2012.02.10 14:57 plg Fixed in Version => 2.3.3


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Contact
Powered by Mantis Bugtracker