MantisBT - Piwigo
View Issue Details
0001277Piwigoweb APIpublic2009.11.23 23:362009.12.07 23:32
plg 
plg 
normalminoralways
closedfixed 
2.0.0 
2.0.72.0.7 
any
Apache 1.3.x
0001277: [pwg.images.setInfo] warning or error when trying to associate a photo with a given category twice
When trying to associate a photo with a category that is already associated, depending on the error reporting level, we get a warning or a blocking error.
[mysql error 1062] Duplicate entry \'4618-605\' for key 1

INSERT INTO piwigo_image_category
  (image_id,category_id,rank)
  VALUES(\'4618\',\'605\',\'5\')

0000001 my_error /home/pierrick/public_html/piwigo/dev/branches/2.0/include/functions.inc.php(602)
0000002 pwg_query /home/pierrick/public_html/piwigo/dev/branches/2.0/admin/include/functions.php(471)
0000003 mass_inserts /home/pierrick/public_html/piwigo/dev/branches/2.0/include/ws_functions.inc.php(1830)
0000004 ws_add_image_category_relations /home/pierrick/public_html/piwigo/dev/branches/2.0/include/ws_functions.inc.php(1728)
0000005 ws_images_setInfo ()
#6 call_user_func_array /home/pierrick/public_html/piwigo/dev/branches/2.0/include/ws_core.inc.php(533)
#7 PwgServer::invoke /home/pierrick/public_html/piwigo/dev/branches/2.0/include/ws_protocols/rest_handler.php(52)
#8 PwgRestRequestHandler::handleRequest /home/pierrick/public_html/piwigo/dev/branches/2.0/include/ws_core.inc.php(361)
0000009 PwgServer::run /home/pierrick/public_html/piwigo/dev/branches/2.0/ws.php(385)
No tags attached.
Issue History
2009.11.23 23:36plgNew Issue
2009.11.23 23:36plgStatusnew => assigned
2009.11.23 23:36plgAssigned To => plg
2009.11.23 23:36plgbrowser => any
2009.11.23 23:36plgWeb server => Apache 1.3.x
2009.12.07 23:28svnCheckin
2009.12.07 23:28svnNote Added: 0003196
2009.12.07 23:30svnCheckin
2009.12.07 23:30svnNote Added: 0003198
2009.12.07 23:31plgFixed in Version => 2.0.7
2009.12.07 23:31plgStatusassigned => closed
2009.12.07 23:32plgResolutionopen => fixed

Notes
(0003196)
svn   
2009.12.07 23:28   
[Subversion] r4444 by plg on branch 2.0

-----[Subversion commit log]----------------------------------------------------
feature 1312 added: pwg.images.setInfo can replace multiple values propreties
(tags/categories). The primary condition is to provide "tag_ids" and/or
"categories" input parameters, ie pwg.images.set won't create emptiness. You
can reduce the set of tags/categories but not remove all tags/categories.

bug 1277 fixed: with a stronger algorithm for adding/replacing categories, we
now avoid to recreate an existing image_category association.

When a remote client calls pwg.images.setInfo, Piwigo returns an error 500 if:
1. the "categories" parameter is malformed (no numeric id inside)
2. one of the input categories does not exist at database level.
(0003198)
svn   
2009.12.07 23:30   
[Subversion] r4445 by plg on trunk

-----[Subversion commit log]----------------------------------------------------
merge r4444 from branch 2.0 to trunk

feature 1312 added: pwg.images.setInfo can replace multiple values propreties
(tags/categories). The primary condition is to provide "tag_ids" and/or
"categories" input parameters, ie pwg.images.set won't create emptiness. You
can reduce the set of tags/categories but not remove all tags/categories.

bug 1277 fixed: with a stronger algorithm for adding/replacing categories, we
now avoid to recreate an existing image_category association.

When a remote client calls pwg.images.setInfo, Piwigo returns an error 500 if:
1. the "categories" parameter is malformed (no numeric id inside)
2. one of the input categories does not exist at database level.