FIX: fix submissions grid field in 3.0 versions (#96, #100)

This commit is contained in:
Will Rossiter 2013-03-16 12:18:51 +13:00
parent 5d3d3e1b00
commit 416a5b8864
3 changed files with 6 additions and 8 deletions

View File

@ -34,14 +34,14 @@ class UserFormsGridFieldFilterHeader extends GridFieldFilterHeader {
// retrieve a list of all the available form fields that have been
// submitted in this form.
$params = $gridField->getForm()->getController()->getURLParams();
$formFields = SubmittedFormField::get()
->filter(array(
"SubmittedForm.ParentID" => $gridField->getList()->column()
))
->where(sprintf("SubmittedForm.ParentID = '%s'", Convert::raw2sql($params['ID'])))
->leftJoin('SubmittedForm', 'SubmittedFormField.ParentID = SubmittedForm.ID')
->sort('Title', 'ASC')
->map('Name', 'Title');
// 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(

View File

@ -118,9 +118,7 @@ class UserDefinedForm extends Page {
// attach every column to the print view from
$columns = SubmittedFormField::get()
->filter(array(
"SubmittedForm.ParentID" => $this->ID
))
->where("SubmittedForm.ParentID = '$this->ID'")
->leftJoin('SubmittedForm', 'SubmittedFormField.ParentID = SubmittedForm.ID')
->map('Name', 'Title');

View File

@ -9,6 +9,6 @@
"email": "will@fullscreen.io"
}],
"require": {
"silverstripe/framework": ">=3.1.*@dev"
"silverstripe/framework": "3.*"
}
}