FIX Avoid having search fields with the same names as form elements

This commit is contained in:
Guy Marriott 2018-09-27 17:39:50 +12:00
parent 2f67be61c1
commit c54e7317d2
No known key found for this signature in database
GPG Key ID: A80F9ACCB86D3DA7

View File

@ -264,6 +264,11 @@ class GridFieldFilterHeader implements GridField_URLHandler, GridField_HTMLProvi
return new HTTPResponse(_t(__CLASS__ . '.SearchFormFaliure', 'No search form could be generated'), 400); return new HTTPResponse(_t(__CLASS__ . '.SearchFormFaliure', 'No search form could be generated'), 400);
} }
// Append a prefix to search field names to prevent conflicts with other fields in the search form
foreach ($searchFields as $field) {
$field->setName('Search__' . $field->getName());
}
$columns = $gridField->getColumns(); $columns = $gridField->getColumns();
// Update field titles to match column titles // Update field titles to match column titles