Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Empty $Messageblocks on checkfields

Go to End

8 Posts   1182 Views


Community Member, 59 Posts

11 October 2013 at 5:55am

Just upgraded my working 2.4.9 site to 2.4.13 and now all the cms checkboxes appear with little green blocks after them.
Looks like some sort of validation gone wrong - the only things changed were the cms and sapphire folders - help !!!!

If it helps ....
$messageblock in checkboxField has class = "message " in it after each checkbox field!



Community Member, 3 Posts

11 October 2013 at 7:40pm

Edited: 11/10/2013 7:43pm

Hi Martin,

The same issue with my upgraded site too! I have not yet found the time to investigate the issue, but I'm also not a hard core SS developer and so far what I have found is what you have just described: now we have lots of class = "message " attributes of empty span tags in the standard forms, basically empty messages. An example can be seen in the middle of this page:

Can anyone shed a light on this?


Community Member, 59 Posts

11 October 2013 at 10:19pm

Edited: 11/10/2013 10:21pm

Cheap and cheerful solution:-
in \sapphire\forms\CheckboxField.php around line 51

comment out the isset line and replace with test for content

// $messageBlock = isset($Message) ? "<span class=\"message $MessageType\">$Message</span>" : '';
$messageBlock = strlen($Message>0) ? "<span class=\"message $MessageType\">$Message</span>" : '';

The reason is the new casting variable `Message` that appears in \saphhire\forms\FormField.php
so isset is always true.

( the casting variable below is new in 2.4.13
* @var Custom Validation Message for the Field
protected $customValidationMessage = "";

public static $casting = array(
'Message' => 'Text'

This fix will be fine for me until a proper solution is forthcoming ....


Community Member, 3 Posts

12 October 2013 at 5:37am

Edited: 12/10/2013 5:45am

Thank you for the quick fix, worked fine! Someone should share it with the dev team via, so that it gets noticed somehow. I do not think they have too much time reading the forum, do they?



Community Member, 59 Posts

13 October 2013 at 2:18am

Hmm I think you may be right.
Had always just assumed the devs hung out here as well but guess not.


Forum Moderator, 1391 Posts

14 October 2013 at 9:42pm

Edited: 14/10/2013 9:45pm

It's true, core devs don't seem to be hanging around here as much as before. Used to be these forums were about the only source of information on SilverStripe but that is no longer the case.

But if you find a bug in SilverStripe, or better, if you found out what's causing it and even have a fix, like here, the place to be is on GitHub, where you can create an issue to report a bug - or offer a solution if it has already been reported:

Be sure to mention the version. A pull request might even be better, depending on your experience with Git(Hub). Read more about contributing here:


Community Member, 165 Posts

23 November 2013 at 12:43am

Lifesaver! Thanks heaps for that. :)


Community Member, 14 Posts

12 December 2013 at 4:24am

Yep, found this thread before the github issue

I've done a pull request directly from (as mentioned here: