Hi all,
I get some weird special characters when opening a cms page. See attachement
I have already the latest update of Silverstripe (3.0.2) and FireBug has no Error in it.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
Hi all,
I get some weird special characters when opening a cms page. See attachement
I have already the latest update of Silverstripe (3.0.2) and FireBug has no Error in it.
Hi!
This is the most strange thing I’ve ever seen with SilverStripe. These are not special characters, but escaped new lines (\n) and tabulators (\t). That could happen because the Ajax process responsible for updating of the CMS interface is not decoding the response, but I don’t have a clue about how to fix it.
Good luck!
Juan
Yeah i've got the most strange error ever! :) :(
However, I found out it's in particular Pagetype. The code:
PhotoPagina.php:
class PhotoPagina extends Page {
public static $has_many = array(
'Fotos' => 'Photo'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$gridFieldConfig = GridFieldConfig_RecordEditor::create();
$gridfield = new GridField("Fotos", "Fotos", $this->Fotos(), $gridFieldConfig);
$fields->addFieldToTab('Root.GalleryImages', $gridfield);
return $fields;
}
}
class PhotoPagina_Controller extends Page_Controller {
public static $allowed_actions = array (
);
public function init() {
parent::init();
Requirements::themedCSS('jquery-ui');
Requirements::themedCSS('fotoalbum');
Requirements::themedCSS('jquery-fancybox-1.2.6');
Requirements::JavaScript('http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js');
Requirements::JavaScript('themes/nkwa/javascript/fancybox/jquery.fancybox-1.2.6.pack.js');
Requirements::JavaScript('themes/nkwa/javascript/vendor/fotoalbum.js');
}
...
}
Photo.php
class Photo extends DataObject {
static $db = array(
);
static $has_one = array(
'Plaatje' => 'Image',
'FotoPagina' => 'PhotoPagina'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->removeFieldFromTab("Root.Main","PhotoPaginaID");
return $fields;
}
public static $summary_fields = array(
'ID' => 'ID',
'Thumbnail' => 'Thumbnail'
);
public function getThumbnail() {
return $this->Image()->CMSThumbnail();
}
}
I tried almost everything (by removing it) to fix it, but nothing did work out so far. I think it's something in the gridfieldconfig?
Have you tried removing all the JavaScript requirements in PhotoPagina.php?
Do you get any JS errors? Which browser? Does it happen on the default language (English US) as well?
Which SilverStripe release are you running?
Can you please view the XHR/Ajax request in Chrome's developer tools "Network" panel,
right click on the entry, "save as HAR" and attach here? If its on a live server,
please either remove all cookie data from it, or email me privately to ingo at silverstripe dot com.
We were having the same issue. In our case, the PHP files has the wrong text encoding.
Compare the encoding of the PHP class files that are giving you the error with files that are not, and change the encoding accordingly.