Hello/Hi/Greetings,
When i try to return with API this:
http://iphoto.macweb.cz/ws.php?format=r … order=name
or any type of order by... (if i put order by away is ok but what if i need to sort it?)
i get this mysql error:
[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 'name' at line 7
SELECT id
FROM ip2_images i
INNER JOIN ip2_image_category ic ON id=ic.image_id
INNER JOIN ip2_image_tag it ON id=it.image_id
WHERE tag_id IN (261)
GROUP BY id
name
Piwigo version: 2.7.4
Offline
the error is in http://piwigo.org/dev/browser/trunk/inc … s.php#L113
"ws_std_image_sql_order" does not prepend 'ORDER BY'
Offline
It looks very strange for me. I cannot reproduce the issue.
mistic100 wrote:
the error is in http://piwigo.org/dev/browser/trunk/inc … s.php#L113
"ws_std_image_sql_order" does not prepend 'ORDER BY'
You're right ws_std_image_sql_order() does not prepend "ORDER BY" but with a query like
ws.php?format=rest&method=pwg.tags.getImages&tag_name=best1&per_page=1&order=name
params array given to ws_std_image_sql_order() contains order key and that function return 'i.name'.
"ORDER BY" is prepend at line 116 because $order_by is not empty.
Offline
I understand. I tried to reproduce issue on piwigo developement version and the issue has already been reported and fixed :
http://piwigo.org/bugs/view.php?id=3163
and fixed in
http://piwigo.org/dev/changeset/30359
Sorry for noise!
Offline
oops I read the code too fast :)
Offline
rvelices why it wasn't merged in working branch ?
Offline
mistic100 wrote:
rvelices why it wasn't merged in working branch ?
Probably forgot about it ...
Offline
you targeted 2.8.0 so I though there was a reason
Offline
So it will be fixed in 2.8.0? I actually build my portfolio page on that API so i would be very happy that sorting work since then. It takes some time since then becouse adobe have a lot of bugs in export scripts so i wait first that they fix something too :).
Offline
Thanks i use this fix and its ok. Now my web portfolio works as i hope.
nicolas wrote:
I understand. I tried to reproduce issue on piwigo developement version and the issue has already been reported and fixed :
http://piwigo.org/bugs/view.php?id=3163
and fixed in
http://piwigo.org/dev/changeset/30359
Sorry for noise!
Offline