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.

Widgets /

Discuss SilverStripe Widgets.

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

SS3 Widget Module/WidgetAreaEditor Breaks CMS AJAX Functionality


Reply


2 Posts   1054 Views

Avatar
HARVS1789UK

Community Member, 21 Posts

16 February 2013 at 12:02am

Edited: 16/02/2013 12:03am

I have a strange problem on the last two SS sites I have built (both are SS3.0.1 and above). I understand that the Widget Module is no longer packaged with a base SS install anymore so I have downloaded the Widget Module (https://github.com/silverstripe/silverstripe-widgets) and successfully installed it and created my own widgets etc.

I have given all my Pages the abillity to add Widgets and have this in my Page.php Class:

public static $has_one = array(
"MyWidgetArea" => "WidgetArea"
);

public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Widgets", new WidgetAreaEditor("MyWidgetArea"));
return $fields;
}

The widget area itself works fine and I have no issues with it (with the exception of known bugs when using checkboxes etc) however, when I try to navigate to (or around the tabs within) a page in the CMS that uses the widget area the AJAX loading of that page fails. For example from the SiteTree page list I go to my 'Contact Us' page (which has a WidgetAreaEditor on it) the blue loading bar/overlay appears, ticks away, my URL gets updates and the overlay/loader disappear....but my page location is the same, the appropriate page content has not been loaded in.

Looking at the Network tab in Google Chrome I can see the correct request is being made and data returned with HTTP 200 OK message (see below screenshot), but then nothing happens.

I am certain it is related to Widgets as on all other CMS pages (e.g. Settings, Security etc) the AJAX loading works fine and on any pages where I remove the WidgetAreaEditor functionality it then loads the page correctly e.g. on a page where I want no Widgets configurable I have:

public function getCMSfields() {
$fields = parent::getCMSFields();
$fields->removeByName("Content");
$fields->removeFieldFromTab('Root', 'Widgets');
return $fields;
}

This is driving me crazy and obviously I can't hand the site over to the client and say "to use the CMS click on the appropriate page, then do a page reload because its broken!" :-(

Any help would be much appreciated!

Cheers,

HARVS1789UK

Avatar
HARVS1789UK

Community Member, 21 Posts

2 March 2013 at 3:26am

Edited: 02/03/2013 3:27am

Bump!

Does no body have any ideas :-(

Perhaps more importantly is anyone else actually having this problem?