Fix empty $messageBlock on CheckboxFields

From 2.4.13 the Message attribute is set to Text, so every checkbox now show an empty $messageBlock,
See https://github.com/silverstripe/silverstripe-framework/issues/2489 or http://www.silverstripe.org/general-questions/show/25254
This commit is contained in:
Giulio Bonanome 2013-12-11 16:17:30 +01:00
parent 011ea99f3f
commit b29b49e7d7

View File

@ -47,7 +47,7 @@ class CheckboxField extends FormField {
} else {
extract($this->getXMLValues(array( 'Name', 'Field', 'Title', 'Message', 'MessageType' )),
EXTR_SKIP);
$messageBlock = isset($Message) ? "<span class=\"message $MessageType\">$Message</span>" : '';
$messageBlock = empty($Message) ? '' : "<span class=\"message $MessageType\">$Message</span>";
$Type = $this->XML_val('Type');
$extraClass = $this->XML_val('extraClass');
return <<<HTML