Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit e5401668faa9cff780202cb492c7b5c772c35249 1 parent 8c1f622
Saophalkun Ponlu phalkunz authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 code/controllers/CMSSiteTreeFilter.php
6 code/controllers/CMSSiteTreeFilter.php
View
@@ -194,11 +194,13 @@ public function pagesIncluded() {
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':
Please sign in to comment.
Something went wrong with that request. Please try again.