Jump to:

10843 Posts in 2514 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » HasManyFiles SS 2.3.3

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1532 Views
  • wardog
    Avatar
    Community Member
    9 Posts

    HasManyFiles SS 2.3.3 Link to this post

    HasManyFiles Ver SVN 0.3.2

    [User Error] DataObjectDecorator->setOwner(): Trying to decorate an object of class 'CMSMain' with 'CustomScriptInit', only Dataobject subclasses are supported.
    GET /admin/

    Line 44 in /var/html/sapphire/core/model/DataObjectDecorator.php
    Source

    35    private static $extra_statics_loaded = array();
    36    
    37    function setOwner(Object $owner, $ownerBaseClass = null) {
    38       if(!($owner instanceof DataObject)) {
    39          user_error(sprintf(
    40             "DataObjectDecorator->setOwner(): Trying to decorate an object of class '%s' with '%s',
    41             only Dataobject subclasses are supported.",
    42             get_class($owner), $this->class),
    43             E_USER_ERROR
    44          );
    45          return false;
    46       }
    47       parent::setOwner($owner, $ownerBaseClass);
    48    }
    49
    50    /**

    Trace

    * DataObjectDecorator->setOwner(): Trying to decorate an object of class 'CMSMain' with 'CustomScriptInit', only Dataobject subclasses are supported.
    Line 44 of DataObjectDecorator.php
    * DataObjectDecorator->setOwner(CMSMain,LeftAndMain)
    Line 492 of Object.php
    * Object->__construct()
    Line 74 of RequestHandler.php
    * RequestHandler->__construct()
    Line 274 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    * Director::direct(/admin/)
    Line 118 of main.php

    Humm.. Why i have a error?

  • fiord
    Avatar
    Community Member
    79 Posts

    Re: HasManyFiles SS 2.3.3 Link to this post

    I have encountered the same problem
    Who can tell how to solve it?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: HasManyFiles SS 2.3.3 Link to this post

    Hi

    The HasManyFileManager is not compatible with SilverStripe 2.3.2 (or 2.3.3 for that matter).
    I think it's not worth the effort to further develop that module, since there's a much more versatile module out there: DataObjectManager (http://doc.silverstripe.com/doku.php?id=modules:dataobjectmanager)

    I suggest you try out the DataObjectManager. You'll find out, that you can do the same things (and more) as you were able to do with the HasManyFileManager.
    Maybe I'll write a migration script to move from HasManyFileManager to DataObjectManager (for Websites that were using HasManyFileManager and now want to upgrade to a newer version of SilverStripe)

  • fiord
    Avatar
    Community Member
    79 Posts

    Re: HasManyFiles SS 2.3.3 Link to this post

    Thank you for your prompt response
    I will not wait for new version
    will use DataObjectManager

  • UncleCheese
    Avatar
    4085 Posts

    Re: HasManyFiles SS 2.3.3 Link to this post

    Banal, I think that's a great idea. Let me know if you need anything from me to collaborate on a migration script.

    1532 Views
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.