mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUG Filter pages by LastEdited always returns an empty list
This is caused by the input date values entered by the user are passed into query without converting in a correct format first.
This commit is contained in:
parent
8c1f622503
commit
e5401668fa
@ -194,11 +194,13 @@ class CMSSiteTreeFilter_Search extends CMSSiteTreeFilter {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'LastEditedFrom':
|
case 'LastEditedFrom':
|
||||||
$query->where("\"LastEdited\" >= '$SQL_val'");
|
$fromDate = new DateField(null, null, $SQL_val);
|
||||||
|
$query->where("\"LastEdited\" >= '{$fromDate->dataValue()}'");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'LastEditedTo':
|
case 'LastEditedTo':
|
||||||
$query->where("\"LastEdited\" <= '$SQL_val'");
|
$toDate = new DateField(null, null, $SQL_val);
|
||||||
|
$query->where("\"LastEdited\" <= '{$toDate->dataValue()}'");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'ClassName':
|
case 'ClassName':
|
||||||
|
Loading…
Reference in New Issue
Block a user