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

DataObjectDecorator not extending all functions?


Go to End


1113 Views

Avatar
MarijnKampf

Community Member, 176 Posts

3 December 2010 at 10:40pm

I've writing some code that adds a Related Pages tab to the CMS and allows you to select related pages. As my code originally was added to the Page class I thought I would change it to a generic module. I however ran into a problem, which my be a bug.

First I had to change the Page_Related.RelatedID column in the database to Page_Related.ChildID (This could be a DataObjectManager issue rather than the CMS - and potentially easily solved).

After correcting this I'm getting the error:
<b>Fatal error</b>: Call to undefined method Related::extendedSQL() in <b>G:\localhost\largeherbivore.org\sapphire\core\model\DataObject.php</b> on line <b>1429</b><br />

I thought that
class Related extends DataObjectDecorator
+
Object::add_extension('Page', 'Related');
should have taken care of the object inheritance?

Why isn't the DataObjectDecorator missing the functions that work for the Page extened version? I've included the codes for both the module version and the non module version of the code.

Attached Files