751 Posts in 310 Topics by 289 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1909 Views |
-
Unable to uncheck Widget checkbox

29 May 2010 at 3:04am Last edited: 29 May 2010 8:18am
Hi there,
I have the following problem and it's driving me nuts. I have several Widgets (on a 2.3.7 installation) like this one:
<?php
class HyperlinkWidget extends Widget {
static $db = array(
'WidgetTitle' => 'Varchar',
'Option1' => 'Boolean',
'Option2' => 'Boolean',
'Option3' => 'Boolean',
'Option4' => 'Boolean',
'Option5' => 'Boolean',
'Option6' => 'Boolean',
'Option7' => 'Boolean',
'HyperlinkTitle1' => 'Varchar',
'HyperlinkTitle2' => 'Varchar',
'Hyperlink1' => 'Varchar',
'Hyperlink2' => 'Varchar'
);//static $title = "Meer weten?";
static $cmsTitle = "Call to action";
static $description = "Show 'Call to action' links.";//function Title() {
// return $this->WidgetTitle ? $this->WidgetTitle : self::$title;
//}function onBeforeWrite() {
if (substr($this->Hyperlink1,0,3) == 'www') {$this->Hyperlink1 = 'http://' . $this->Hyperlink1;}
if (substr($this->Hyperlink2,0,3) == 'www') {$this->Hyperlink2 = 'http://' . $this->Hyperlink2;}
parent::onBeforeWrite();
}function getCMSFields() {
return new FieldSet(
new TextField('WidgetTitle', 'Title (optional)'),
new CheckboxField('Option1', _t('HyperlinkWidget.OPTION1')),
new CheckboxField('Option6', _t('HyperlinkWidget.OPTION6')),
new CheckboxField('Option7', _t('HyperlinkWidget.OPTION7')),
new CheckboxField('Option2', _t('HyperlinkWidget.OPTION2')),
new CheckboxField('Option3', _t('HyperlinkWidget.OPTION3')),
new CheckboxField('Option4', _t('HyperlinkWidget.OPTION4')),
new CheckboxField('Option5', _t('HyperlinkWidget.OPTION5')),
new TextField('Hyperlink1', 'Additional hyperlink 1 (optional)'),
new TextField('HyperlinkTitle1', 'Hyperlink title (optional)'),
new TextField('Hyperlink2', 'Additional hyperlink 2 (optional)'),
new TextField('HyperlinkTitle2', 'Hyperlink title (optional)')
);
}}
?>
Now it's perfectly possible to check the checkboxes, but unimpossible to uncheck them after they are checked. Whatever I try, unchecking (followed by 'Save and publish') shows the unchecked checkbox, but upon reload of the CMS the checkbox is checked again
Anyone dealt with this before and/or any suggestion where to look for the cause of this problem? Thx thx thx!
-
Re: Unable to uncheck Widget checkbox

20 December 2010 at 8:06pm
I'm having the exact same issue. This is really obnoxious. Basic Field / ORM binding going on here! Moderators, please have a look at this.. it's like a bug!
-
Re: Unable to uncheck Widget checkbox

1 February 2011 at 6:29am
Hello,
I have the same problem. The CheckboxField is working on a normal module but don´t do anything on a widget.
Best regards,
chrclaus -
Re: Unable to uncheck Widget checkbox

1 February 2011 at 6:35am
Tons of formfields don't work in the widget sidebar, my suggestion would be to try an Enum(Yes,No). Or a Textfield for Y/N and you do some jQuery to make it behave/look like a checkbox.
Also to get a response I'd check open.silverstripe.com for a known issue - else raise it (worse case they reject it!)
-
Re: Unable to uncheck Widget checkbox

1 February 2011 at 10:14pm
Hi,
I found a the ticket #6288 (http://open.silverstripe.org/ticket/6288) which describes the situation. From my point of view this ticket was not committed to any version.
Does anybody else have more informations about this ticket?Best regards,
chrclaus -
Re: Unable to uncheck Widget checkbox

2 February 2011 at 12:19am
I applies this patch to version 2.4.4 I´m using. At the moment all widgets and the checkboxes are working .
Beside the authors comment in the ticket is there any reason, why this patch is not visible in the daily builds?
-
Re: Unable to uncheck Widget checkbox

18 November 2011 at 4:40am
Same problem still exists in 2.4.6 !!! WTF? Any reason this hasn't been applied to trunk?
| 1909 Views | ||
|
Page:
1
|
Go to Top |



