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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

CMS Not decoding JSON


Go to End


2 Posts   654 Views

Avatar
Babalou

Community Member, 21 Posts

31 March 2016 at 2:47am

Edited: 31/03/2016 2:50am

My CMS has stopped decoding Json so that to see a CMS page one must always reload after clicking a menu. If you do not reload the source of the page looks something like this:
{"Content":"<div id=\"pages-controller-cms-content\" class=\"has-panel cms-content center cms-tabset CMSPageEditController CMSMain LeftAndMain\" data-layout-type=\"border\" data-pjax-fragment=\"Content\" data-ignore-tab-state=\"true\">\n\n\t<div class=\"cms-content-header north\">\n\t\t\n\n\t\t<div class=\"cms-content-header-nav\">\n\t\t\t<div class=\"breadcrumbs-wrapper\" data-pjax-fragment=\"Breadcrumbs\">\n\t<h2 id=\"page-title-heading\">\n\t\t\n\t\t\t\n\t\t\t\t

After the reload you get HTML.
This is a major pain. What could be causing it?
I have a custom SiteCofig and one or two custom ModelAdmins but these are not complex things.
Where can I go looking for an error?

[edit] Currently using Version 3.2.1 of the Framework and CMS

Avatar
Babalou

Community Member, 21 Posts

31 March 2016 at 5:51am

For the benefit of the next person who runs into this problem:
A single tab before the PHP open tag in a ModelAdmin extension class file caused this.
While it was simple enough to discover this error it was somewhat arduous and debugging would have been much simpler if the error were reported somewhere.
As it is I had no way of knowing where the failure actually happened and I had no way to trace it back to the ModelAdmin extension class other than by following my nose.