mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Don't use _SortColumn syntax when randomly sorting.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76370 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f296534380
commit
32ed6da54c
@ -201,7 +201,7 @@ class SQLQuery extends Object {
|
|||||||
|
|
||||||
// If sort contains a function call, let's move the sort clause into a separate selected field.
|
// If sort contains a function call, let's move the sort clause into a separate selected field.
|
||||||
// Some versions of MySQL choke if you have a group function referenced directly in the ORDER BY
|
// Some versions of MySQL choke if you have a group function referenced directly in the ORDER BY
|
||||||
if($combinedOrderby && strpos($combinedOrderby,'(') !== false) {
|
if($combinedOrderby && strpos($combinedOrderby,'(') !== false && strtoupper(trim($combinedOrderby)) != 'RAND()') {
|
||||||
// Sort can be "Col1 DESC|ASC, Col2 DESC|ASC", we need to handle that
|
// Sort can be "Col1 DESC|ASC, Col2 DESC|ASC", we need to handle that
|
||||||
$sortParts = explode(",", $combinedOrderby);
|
$sortParts = explode(",", $combinedOrderby);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user