Skip to content

Commit

Permalink
Set unique name for AddNewMultiClass Selects
Browse files Browse the repository at this point in the history
fixing wrong behaviour when having multiple Gridfields containing AddNewMultiClass Selects on one form
  • Loading branch information
flxqr2 authored Apr 13, 2017
1 parent 302f7c0 commit 7e2dda0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/GridFieldAddNewMultiClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function getHTMLFragments($grid) {

GridFieldExtensions::include_requirements();

$field = new DropdownField(sprintf('%s[ClassName]', __CLASS__), '', $classes);
$field = new DropdownField(sprintf('%s[%s]', __CLASS__, $grid->getName()), '', $classes, $this->defaultClass);
$field->setEmptyString(_t('GridFieldExtensions.SELECTTYPETOCREATE', '(Select type to create)'));
$field->addExtraClass('no-change-track');

Expand Down

0 comments on commit 7e2dda0

Please sign in to comment.