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

error with 2.3.2-rc1 & getBannerImageRecursive()


Go to End


2 Posts   1159 Views

Avatar
patte

Community Member, 63 Posts

27 May 2009 at 12:11am

Hi,

I am using the receipe getBannerImageRecursive() mentioned in the SilverStripe Buch.

Updating SilverStripe to rc1 I get the following error uploading my BannerImage.

There has been an error
The website server has not been able to respond to your request.

class Page extends SiteTree {

	static $has_one = array(
		'BannerImage' => 'Page_BannerImage'
	);
	
	function getBannerImageRecursive() {
		$page = $this;
		$banner = $this->BannerImage();
		while(!$banner->ID && $page->ParentID != 0) {
			$page = $page->Parent();
			$banner = $page->BannerImage();
		}
		return $banner;
	}
	
	function getCMSFields() {
	$fields = parent::getCMSFields();	
	$fields->addFieldToTab('Root.Content.Header', new ImageField('BannerImage', 'Banner'));
	
	return $fields;
	}
   
}


class Page_BannerImage extends Image {
	
	function generateFullWidth($gd) {
		$gd->setQuality(80);
		return $gd->croppedResize(934,267);
	}

}

Does someone have an idea how to fix this?

Thanks much! Patte

Avatar
patte

Community Member, 63 Posts

27 May 2009 at 12:33am

hey guys,

I made a clean install (the third one) and now the error ist gone! Seems that the rc1 is a great release!

patte