BUGFIX #3188: Fixed default HeaderField name to be non-conflicting with other fields, for backward compat

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69695 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-01-05 04:33:16 +00:00
parent 2314eba053
commit 5f9120e99e

View File

@ -18,7 +18,9 @@ class HeaderField extends DatalessField {
$args = func_get_args(); $args = func_get_args();
if(!isset($args[1]) || is_numeric($args[1])) { if(!isset($args[1]) || is_numeric($args[1])) {
$title = (isset($args[0])) ? $args[0] : null; $title = (isset($args[0])) ? $args[0] : null;
$name = $title; // this means i18nized fields won't be easily accessible through fieldByName() // Use "HeaderField(title)" as the default field name for a HeaderField; if it's just set to title then we risk
// causing accidental duplicate-field creation.
$name = 'HeaderField' . $title; // this means i18nized fields won't be easily accessible through fieldByName()
$headingLevel = (isset($args[1])) ? $args[1] : null; $headingLevel = (isset($args[1])) ? $args[1] : null;
$allowHTML = (isset($args[2])) ? $args[2] : null; $allowHTML = (isset($args[2])) ? $args[2] : null;
$form = (isset($args[3])) ? $args[3] : null; $form = (isset($args[3])) ? $args[3] : null;