Hello, am getting a 500 Internal Server error in Firebug when I try to load a .ss template via Ajax. I'm following the Ajax basics recipe to a T.
Any ideas?
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.
Hello, am getting a 500 Internal Server error in Firebug when I try to load a .ss template via Ajax. I'm following the Ajax basics recipe to a T.
Any ideas?
Put the site in dev mode or look at your server error logs.
Its been in dev mode the whole time and the error logs aren't showing anything out of the ordinary.
Well thats strange, can you track it down to a specific line (by commenting out code). Post some more information about the function. What happens when you hit the url directly rather than via with ajax.
Here's the function:
function showArticleImages() {
if($this->isAjax) {
if($photos = DataObject::get("Photo", "ProfileID = {$this->ID}")) {
return $this->customise(array(
'Photos' => $photos
))->renderWith('articleImages');
} else {
return "Oops, you don't have any photos uploaded yet. <a href=\"{$this->Link('newPhoto')}\" onclick=\"confirmExit('{$this->Link('newPhoto')}'); return false;\">Click here to upload some</a>.";
}
} else {
return Array();
}
}
When I go to the page url directly, it just displays the parent page template. Template file, articleImages.ss, is residing in the templates folder next to the top-level Page.ss so that it doesn't pull the header or footer in.
The Ajax works fine though, no problem with that.