From b096cf611a003e58537e94aca1ff9186ae04673d Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Thu, 21 Mar 2013 23:22:51 +1300 Subject: [PATCH] FIX: update DropdownField usage for 3.1 --- code/UserFormsGridFieldFilterHeader.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/code/UserFormsGridFieldFilterHeader.php b/code/UserFormsGridFieldFilterHeader.php index 3eefb83..ce02ebb 100644 --- a/code/UserFormsGridFieldFilterHeader.php +++ b/code/UserFormsGridFieldFilterHeader.php @@ -44,14 +44,11 @@ class UserFormsGridFieldFilterHeader extends GridFieldFilterHeader { // show dropdown of all the fields available from the submitted form fields // that have been saved. Takes the titles from the currently live form. - $columnField = new DropdownField( - 'FieldNameFilter', - '', - $formFields->toArray(), - $selectedField, - null, - _t('UserFormsGridFieldFilterHeader.FILTERSUBMISSIONS', 'Filter Submissions..') - ); + $columnField = new DropdownField('FieldNameFilter', ''); + $columnField->setSource($formFields->toArray()); + $columnField->setEmptyString(_t('UserFormsGridFieldFilterHeader.FILTERSUBMISSIONS', 'Filter Submissions..')); + $columnField->setHasEmptyDefault(true); + $columnField->setValue($selectedField); $valueField = new TextField('FieldValue', '', $selectedValue);