23481 Posts in 18965 Topics by 2878 members
|Go to End|
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!
11 October 2013 at 7:40pm Last edited: 11 October 2013 7:43pm
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: http://pestbudakarate.hu/Security/login
Can anyone shed a light on this?
11 October 2013 at 10:19pm Last edited: 11 October 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 ....
12 October 2013 at 5:37am Last edited: 12 October 2013 5:45am
Thank you for the quick fix, worked fine! Someone should share it with the dev team via firstname.lastname@example.org, so that it gets noticed somehow. I do not think they have too much time reading the forum, do they?
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.
14 October 2013 at 9:42pm Last edited: 14 October 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: https://github.com/silverstripe/silverstripe-framework/issues.
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:
23 November 2013 at 12:43am
Lifesaver! Thanks heaps for that.
12 December 2013 at 4:24am
Yep, found this thread before the github issue https://github.com/silverstripe/silverstripe-framework/issues/2489
I've done a pull request directly from github.com (as mentioned here: http://doc.silverstripe.org/framework/en/trunk/misc/contributing/code)
|Go to Top|