mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02: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
@ -423,17 +423,17 @@ 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());
|
||||
|
||||
$actions = new FieldSet(
|
||||
$createButton = new FormAction('add', $buttonLabel)
|
||||
);
|
||||
|
||||
|
||||
$form = new Form($this, "CreateForm",
|
||||
new FieldSet(),
|
||||
$createButton = new FormAction('add', $buttonLabel),
|
||||
$validator = new RequiredFields()
|
||||
);
|
||||
|
||||
$createButton->dontEscape = true;
|
||||
|
||||
$validator = new RequiredFields();
|
||||
$validator->setJavascriptValidationHandler('none');
|
||||
|
||||
return new Form($this, "CreateForm", new FieldSet(), $actions, $validator);
|
||||
$form->setHTMLID("Form_CreateForm_" . $this->modelClass);
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -488,6 +488,7 @@ class ModelAdmin_CollectionController extends Controller {
|
||||
$actions,
|
||||
$validator
|
||||
);
|
||||
$form->setHTMLID("Form_ImportForm_" . $this->modelClass);
|
||||
return $form;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user