From 46dc3399767a8841f1c7d6db51478c68e52d56d6 Mon Sep 17 00:00:00 2001 From: Nathan Glasl Date: Fri, 8 Jun 2018 15:58:47 +1000 Subject: [PATCH] [FIX] This resolves issue #17 and improves the documentation. --- README.md | 4 ++-- src/controllers/MediaHolderController.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a4aa2a0..09c3dfd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [mediawesome](https://packagist.org/packages/nglasl/silverstripe-mediawesome) -_The current release is **4.0.1**_ +_The current release is **4.0.2**_ > This module allows creation of dynamic media holders/pages with CMS customisable types and attributes (blogs, events, news, publications), including versioning. @@ -91,7 +91,7 @@ Customisation of media types and their respective attributes will be restricted. A media holder request may have optional date, category and tag filters, which are extendable by developers. -Retrieve the date filter form in the media holder template: +The following on the media holder template allows a user to select a date, and then see media pages for and prior to that date: ```php $DateFilterForm diff --git a/src/controllers/MediaHolderController.php b/src/controllers/MediaHolderController.php index e065a47..776c2a9 100644 --- a/src/controllers/MediaHolderController.php +++ b/src/controllers/MediaHolderController.php @@ -428,13 +428,9 @@ public function getDateFilterForm() { ); $form->setFormMethod('get'); - // Display existing request filters. - - $request = $this->getRequest(); - $form->loadDataFrom($request->getVars()); - // Remove validation if clear has been triggered. + $request = $this->getRequest(); if($request->getVar('action_clearFilters')) { $form->unsetValidator(); } @@ -442,6 +438,10 @@ public function getDateFilterForm() { // Allow extension customisation. $this->extend('updateFilterForm', $form); + + // Display existing request filters. + + $form->loadDataFrom($request->getVars()); return $form; }