Problems with Database/Query.php Order_by clause

Problems with Database/Query.php Order_by clause

tklinetkline Posts: 6Questions: 0Answers: 0
edited August 2012 in Bug reports
You reference $alias in Database/Query.php order() method on line 346. There is no other use of $alias in that method, and it fails to construct the order by clause correctly.

Changing [code]$identifier = substr($order[$i], 0, - strlen($alias));[/code] to [code]$identifier = substr($order[$i], 0, - strlen($direction));[/code] makes it work, but I'm not sure if that yields the intended result.


Also, the _build_order() method is missing the required clause "ORDER BY" text when building the clause, on line 588.

Tom

Replies

  • allanallan Posts: 61,918Questions: 1Answers: 10,151 Site admin
    Hi Tom,

    Thanks very much for flagging this up. I've committed the fixes required, and they will be included in Editor 1.2.1 release in the next couple of days.

    Your fix is absolutely correct above, although the comments were a little wonky (also now fixed) - think it was a bad office day when writing that function...

    Regards,
    Allan
This discussion has been closed.