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

[SOLVED?] SS3.0.0 CMS Ajax Issues


Reply


7 Posts   1046 Views

Avatar
Mo

Community Member, 510 Posts

1 July 2012 at 11:37pm

Edited: 01/07/2012 11:38pm

Hey all,

Don't know if I am the only one getting this, but I have been upgrading some of my 2.4.x projects to 3.0.0 and under "Pages" in the CMS, whenever I click a link, the little loading bar appears, but then nothing loads :-(.

What is stranger is that the URL changes, and if I refresh the page the correct form loads, but I have to do this after every time I click a link!

My current setup is:

Project: git project
-- framework: git submodule (sapphire)
-- cms: git submodule (silverstripe-cms)
-- mysite
-- themes
---- mytheme
-- .htaccess

Server is apache 2.2 with PHP 5.3

Really causing me to scratch my head! I have tried installing a new version from the website and that works, but I am getting the same problem across 3 sites I am upgrading.

Any thoughts? Cheers in advance :-)

Mo

Avatar
Mo

Community Member, 510 Posts

2 July 2012 at 5:44am

So I got this kind of working now.

I ended up trying on one of the smaller sites (without much content) that I am upgrading, deleting all the local files and then re-checking out everything.

I also created a new database, but I a not convinced this was the issue.

For some reason this seems to have fixed the problem. I can only assume that maybe something from the previous version of SS may have been cached and was conflicting, but that seems quite odd, and I also tried ?flush=all as well which doesn't help.

I guess if any one else gets this issue upgrading, try:

1. Backing up your install.
2. Deleting your cache.
3. Deleting all local files (including cache).
4. Re-install from scratch and run /dev/build/?flush=all

5. (optional) pray to a higher power! :-)

Mo

Avatar
theorytank

Community Member, 8 Posts

4 July 2012 at 9:07am

I'm still having this issue. I've tried re-installing etc. I don't have the CMS module installed, just the framework, and I have two very simple model admins defined. So I have 3 tabs (including Security) and I can't switch between any of them.

The JS error (from firebug) is:

Could not convert JavaScript argument arg 0 [nsIDOMDocumentFragment.appendChild]
http://domain.com/framework/thirdparty/jquery/jquery.js?m=1339536555
Line 6497

Help!!! Anyone!!!

Josh.

Avatar
James Bolitho

Community Member, 33 Posts

17 July 2012 at 11:11pm

Hi,

I seem to be having this issue also. From testing it seems to happen when a form field returns a validation error in the admin area of the CMS, so for example if the passwords don't match on 'ConfirmedPasswordField'.

This seems to be the case in the Security section and a custom Model Admin interface I have created.

Not sure how to fix this at the moment so if anyone has an idea that would be gratefully received.

Thanks,

James

Avatar
colymba

Community Member, 25 Posts

19 July 2012 at 12:42am

I had something similar happening when working on a GridField Component, the loading animation would show up, the URL changes, files/url request would be loaded but nothing would change on the CMS interface.
Chrome would just not show any error, it worked fine in Firefox and IE showed a cryptic error.

It came down to some JS requirement files not loading in the right order. Removing some requirements confirmed it and then delaying the necessary scripts solved the problem.

Hope this helps.

Avatar
hallecsyz

Community Member, 5 Posts

17 August 2012 at 4:28am

I'm having the same issue. Is there any way the cms wont load via ajax? I have other problems because of this, creating hooks for javascript for example. I want the pages to load normally.

Avatar
paradigmincarnate

Community Member, 2 Posts

31 August 2012 at 8:36pm

I had a similar issue. I solved it.

CMS content would not load via AJAX. Content would load fine via a normal request (so, just hit F5 in a decent browser, or correct the URL in IE).

I checked php error logs, Javascript consoles, and set my site into dev mode: Director::set_environment_type('dev'); Nothing produced any errors.

My problem was a _config.php outputting a newline.
Specifically I had a blank line at the start of mysite/_config.php, before the opening php tag.
mysite/_config.php:

{blank line}
<?php
// ...

The response from the server included a blank first line, and then the JSON response, but the JSON response was missing the last character.

{blank line}
{"Content":"..."

--- Wild speculation ---
Perhaps the Content-Length is somehow calculated excluding the newline, so when a newline character is included, the content is bigger than what is reflected in Content-Length. That would potentially cause problems in various servers, proxies, and browsers.
---

I don't think the SilverStripe CMS code should silently handle errors in AJAX responses, especially in dev mode.