MantisBT - Piwigo
View Issue Details
0003211Piwigoweb APIpublic2015.03.15 16:262015.03.16 10:53
Epy 
 
normalcrashalways
newopen 
2.7.4 
 
Mozilla
Apache 2
0003211: Can't give an order to pwg.tags.getImages
Hi,
I was playing with webservices with a python script and web UI here: http://piwigo.org/demo/tools/ws.htm#top [^]
when I got this error:

If I send any authorized value (from the info popup) in the "order" field I get a MySQL error

Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RAND()' at line 8

SELECT id
  FROM images i
    INNER JOIN image_category ic ON id=ic.image_id
    INNER JOIN image_tag it ON id=it.image_id
    WHERE tag_id IN (72)
  AND (category_id NOT IN (9,10,11,12,13,18,28,65,66,67,48,50,71) AND level<=0)
  GROUP BY id
RAND() in /home/sys/var/www/piwigo.org/demo/include/dblayer/functions_mysqli.inc.php on line 830


Fatal error: Call to a member function fetch_assoc() on a non-object in /home/sys/var/www/piwigo.org/demo/include/dblayer/functions_mysqli.inc.php on line 891
Go to: http://piwigo.org/demo/tools/ws.htm [^]

Choose pwg.tags.getImages on the left

Enter a tag id (e.g. 72 'Weather')

Enter an order for sorting from the info button, for example 'random' or 'date_creation'

Select "Invoke", you'll get the error in result frame
I don't have a gallery right now, so I just played with the demo one and didn't try another

That's why I don't have any information on webserver software versions or piwigo version
No tags attached.
duplicate of 0003163closed rvelices pwg.tags.getImages can't handle order 
Issue History
2015.03.15 16:26EpyNew Issue
2015.03.16 10:29rvelicesRelationship addedduplicate of 0003163
2015.03.16 10:53EpyNote Added: 0007783

Notes
(0007783)
Epy   
2015.03.16 10:53   
(Sorry, I didn't see the first bug report when I searched)