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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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



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\\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