Jump to:

791 Posts in 369 Topics by 303 members

Widgets

SilverStripe Forums » Widgets » SS3 Widget Module/WidgetAreaEditor Breaks CMS AJAX Functionality

Discuss SilverStripe Widgets.

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

Page: 1
Go to End
Author Topic: 790 Views
  • HARVS1789UK
    Avatar
    Community Member
    14 Posts

    SS3 Widget Module/WidgetAreaEditor Breaks CMS AJAX Functionality Link to this post

    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

  • HARVS1789UK
    Avatar
    Community Member
    14 Posts

    Re: SS3 Widget Module/WidgetAreaEditor Breaks CMS AJAX Functionality Link to this post

    Bump!

    Does no body have any ideas

    Perhaps more importantly is anyone else actually having this problem?

    790 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.