Jump to:

23472 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » DataObjectDecorator not extending all functions?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 701 Views
  • MarijnKampf
    Community Member
    164 Posts

    DataObjectDecorator not extending all functions? Link to this post

    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
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.