mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUGFIX: Prevent duplicate HTML IDs in ModelAdmin
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@103519 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
53f53bd27f
commit
d36bc64f31
@ -424,16 +424,16 @@ class ModelAdmin_CollectionController extends Controller {
|
|||||||
|
|
||||||
$buttonLabel = sprintf(_t('ModelAdmin.CREATEBUTTON', "Create '%s'", PR_MEDIUM, "Create a new instance from a model class"), singleton($modelName)->i18n_singular_name());
|
$buttonLabel = sprintf(_t('ModelAdmin.CREATEBUTTON', "Create '%s'", PR_MEDIUM, "Create a new instance from a model class"), singleton($modelName)->i18n_singular_name());
|
||||||
|
|
||||||
$actions = new FieldSet(
|
$form = new Form($this, "CreateForm",
|
||||||
$createButton = new FormAction('add', $buttonLabel)
|
new FieldSet(),
|
||||||
|
$createButton = new FormAction('add', $buttonLabel),
|
||||||
|
$validator = new RequiredFields()
|
||||||
);
|
);
|
||||||
|
|
||||||
$createButton->dontEscape = true;
|
$createButton->dontEscape = true;
|
||||||
|
|
||||||
$validator = new RequiredFields();
|
|
||||||
$validator->setJavascriptValidationHandler('none');
|
$validator->setJavascriptValidationHandler('none');
|
||||||
|
$form->setHTMLID("Form_CreateForm_" . $this->modelClass);
|
||||||
return new Form($this, "CreateForm", new FieldSet(), $actions, $validator);
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -488,6 +488,7 @@ class ModelAdmin_CollectionController extends Controller {
|
|||||||
$actions,
|
$actions,
|
||||||
$validator
|
$validator
|
||||||
);
|
);
|
||||||
|
$form->setHTMLID("Form_ImportForm_" . $this->modelClass);
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user