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