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:
Saophalkun Ponlu 2012-08-30 22:42:45 +12:00
parent 8c1f622503
commit e5401668fa

View File

@ -194,11 +194,13 @@ class CMSSiteTreeFilter_Search extends CMSSiteTreeFilter {
break;
case 'LastEditedFrom':
$query->where("\"LastEdited\" >= '$SQL_val'");
$fromDate = new DateField(null, null, $SQL_val);
$query->where("\"LastEdited\" >= '{$fromDate->dataValue()}'");
break;
case 'LastEditedTo':
$query->where("\"LastEdited\" <= '$SQL_val'");
$toDate = new DateField(null, null, $SQL_val);
$query->where("\"LastEdited\" <= '{$toDate->dataValue()}'");
break;
case 'ClassName':