Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Silverstripe 3 page edit screens not being loaded with AJAX

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 965 Views
  • NETim
    Avatar
    Community Member
    24 Posts

    Silverstripe 3 page edit screens not being loaded with AJAX Link to this post

    Hi,

    Found a strange one here.

    We have just started using SS3. A few of our newer sites that use SS3 have an odd issue where the admin system loads and displays the pages/nav/etc but when you click on a page to edit it, the loading dots appear, then disappear but it is still showing the list of pages and not the page edit screen.

    This happens for any page types we create.

    The really odd part, is that if you reload the page, the edit screen is displayed. It seems that, while silverstripe is changing the URL, it doesn't seem to be able to actually push the browser over to the edit screen.

    It's not a major problem as we can still edit sites but it's not something we can give to clients.

    Any ideas what might have caused this?

    Cheers,

    T.

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Silverstripe 3 page edit screens not being loaded with AJAX Link to this post

    You have some whitespace before your opening <?php tag so check your files.

    http://open.silverstripe.org/ticket/8010

  • NETim
    Avatar
    Community Member
    24 Posts

    Re: Silverstripe 3 page edit screens not being loaded with AJAX Link to this post

    Hi Liam,

    Thanks. That solved it.

    T.

  • Krato
    Avatar
    Community Member
    7 Posts

    Re: Silverstripe 3 page edit screens not being loaded with AJAX Link to this post

    Thanks Liam, I was facing the same issue and you pointed me out in the right direction.

    In my case, it was a closing "?>" php tag at the end of one of my files that was causing the issue. Once I deleted, it started working again.

  • FungshuiElephant
    Avatar
    Community Member
    57 Posts

    Re: Silverstripe 3 page edit screens not being loaded with AJAX Link to this post

    I had a similar (the same?) problem with SS 3.0.5. I was loading jQuery 1.7.2 from Google's CDN in the Controller of one of my pages. (1.7.2 is the same version as ships with SS 3.0.5) This works fine on the frontend, but in the admin it ends up loading jQuery twice because the admin interface already loads the local version from thirdparty/jQuery/jQuery.js. The results were a bit unpredictable; sometimes it would work, other times not.

    Having spent more time than I'd like to admit tracing round the javascript in the CMS, I think this was caused by the on demand loading of additional javascript when new pages are created. If I tried to create a page and the system determined that it needed an additional javascript file it would go get it but then fail to parse it (javascript parse error). In my case it was repeatedly loading ToggleCompositeField.js, I think the parse error was caused by having the second copy of jQuery which would have been pulled in in a previous request, hence the unpredictability; the order in which I was doing things in the CMS determined whether the issues appeared or not. Note that the error isn't in ToggleCompositeField.js, it's caused by having 2 copies of jQuery because ToggleCompositeField.js contains jQuery functions.

    If you want to see whether this is the case for you add a complete handler to the getScriptQueue function in jquery.ondemand.js (framework/javascript/jquery-ondemand) like this:
    complete: function(jqXHR, textStatus) {
    console.log('getScriptQueue' + textStatus);
    },
    and watch the console in Firebug or Chrome developer tools. If you get parse errors, you know you got problems.

    An oldish post I know, but this is the nearest I got on Google to solving my problem; hope that helps someone who arrives via the same route.

  • FungshuiElephant
    Avatar
    Community Member
    57 Posts

    Re: Silverstripe 3 page edit screens not being loaded with AJAX Link to this post

    And just to follow up on my own reply re double loading JQuery... I was doing it wrong. You can see that conversation here.

    965 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.