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.

General Questions /

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

Silverstripe 3 page edit screens not being loaded with AJAX


Reply


6 Posts   1170 Views

Avatar
NETim

Community Member, 24 Posts

30 November 2012 at 12:09am

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.

Avatar
Liam

Community Member, 470 Posts

30 November 2012 at 2:50am

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

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

Avatar
NETim

Community Member, 24 Posts

1 December 2012 at 3:01am

Hi Liam,

Thanks. That solved it.

T.

Avatar
Krato

Community Member, 7 Posts

13 April 2013 at 8:45am

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.

Avatar
FungshuiElephant

Community Member, 57 Posts

29 August 2013 at 9:36am

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.

Avatar
FungshuiElephant

Community Member, 57 Posts

29 August 2013 at 10:40pm

And just to follow up on my own reply re double loading JQuery... I was doing it wrong. You can see that conversation [url=https://github.com/silverstripe/silverstripe-cms/issues/826]here[/url].