rsanchez / json

Output ExpressionEngine data in JSON format.
http://devot-ee.com/add-ons/json/
100 stars 236 forks source link

Support for Low Reorder? #27

Closed ghost closed 10 years ago

ghost commented 10 years ago

Would it be possible to implement support for Low Reorder, therefore adding a feature for the custom order of entries? (http://gotolow.com/addons/low-reorder)

rsanchez commented 10 years ago

You should be able to use the low_reorder:entry_ids tag w/ the fixed_order param:

{exp:low_reorder:entry_ids set="1"}
{exp:json:entries fixed_order="{low_reorder:entry_ids}"}
{/exp:low_reorder:entry_ids}
ghost commented 10 years ago

Ah great, that looks like it should work, but I get:

Error Number: 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 '' at line 5

SELECT t.title, t.url_title, t.entry_id, t.channel_id, t.author_id, t.status, t.entry_date, t.edit_date, t.expiration_date, wd.`field_id_5` AS `home_entry_text`, wd.`field_id_6` AS `home_entry_colour`, wd.`field_id_7` AS `home_entry_link`, wd.`field_id_8` AS `home_entry_link_target`, wd.`field_id_9` AS `home_entry_image`, wd.`field_id_10` AS `bootstrap_col_class`, wd.`field_id_15` AS `home_entry_type_class`, wd.`field_id_16` AS `home_entry_text_body` FROM (`exp_channel_titles` t) JOIN `exp_channel_data` wd ON `t`.`entry_id` = `wd`.`entry_id` WHERE `t`.`entry_id` IN ('11', '13', '25', '17', '22', '21', '20', '19', '18', '16', '24', '23', '15', '12') ORDER BY FIELD(t.entry_id, `11`, `13`, `25`, `17`, `22`, `21`, `20`, `19`, `18`, `16`, `24`, `23`, `15`, `12)`

Filename: third_party/json/pi.json.php

Line Number: 186
ghost commented 10 years ago

Any ideas what might be causing the SQL error?

rsanchez commented 10 years ago

I'm getting the error, too. It's a bug in the fixed_order parameter of this plugin, regardless of Low Reorder.

ghost commented 10 years ago

Ok, looking forward to a fix ^^ Cheers!

rsanchez commented 10 years ago

JSON 1.1.2 fixes the error with the fixed_order param. It should work with Low Reorder now.