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.

All other Modules

Discuss all other Modules here.

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

HasManyFiles SS 2.3.3


Reply

5 Posts   1578 Views

Avatar
wardog

20 August 2009 at 2:41pm Community Member, 9 Posts

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?

Avatar
fiord

20 August 2009 at 9:10pm Community Member, 79 Posts

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

Avatar
banal

20 August 2009 at 9:36pm Community Member, 901 Posts

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)

Avatar
fiord

20 August 2009 at 9:57pm Community Member, 79 Posts

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

Avatar
UncleCheese

21 August 2009 at 1:15am 4085 Posts

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