SQL error on creating a new / first set on Low Reoorder 2.0.2
On creating a first new set with Low Reorder 2.0.2 on EE v2.3.1, I get this error (looks like a misplaced quote typo at the end of the SQL statement):
A Database Error Occurred
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 8
SELECT DISTINCT(t.entry_id), 't'.'channel_id', 't'.'title', 't'.'status', 't'.'url_title' FROM ('exp_channel_titles' t) WHERE 't'.'site_id' = 1 AND 't'.'channel_id' IN ('51') AND 't'.'status' IN ('open') AND (t.expiration_date = 0 OR t.expiration_date >= 1337385946) AND 't'.'entry_date' <= 1337385946 ORDER BY FIELD(t.entry_id, '35900', '26927', '26924', '26923', '26922', '26921', '26920', '26919', '26918', '26835', '26834', '26833)'
Filename: third_party/low_reorder/base.low_reorder.php
Line Number: 410
Replies
jayf 19 May 2012 00:24
Also note: I clicked "Save and Reorder" on the create set edit screen. The set is created properly, and I can go in and Edit the set, and save it again. But, if I do "Save and Reorder," I again get the above error.
Also, I can *not* go in and reorder the set from the main module screen, either.
jayf 19 May 2012 01:00
I now think this may be an error / issue with EE / the CI Active record class. I think it's wrongly escaping this input :
$this->EE->db->order_by('FIELD(t.entry_id,'.implode(',', $set_order).')', FALSE, FALSE);
Filename: third_party/low_reorder/base.low_reorder.php
Line Number: 395
it looks like Low Reorder is doing the right thing, but EE / CI is not...
Low 19 May 2012 07:52
Yes, you're right, it's a bug in EE. Upgrading EE will solve it. Are you able to do so?