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.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Files & Images broken when enabling DOM


6 Posts   1205 Views

Carbon Crayon

14 October 2009 at 11:28pm (Last edited: 14 October 2009 11:39pm), Community Member, 598 Posts

Hi Uncle Cheese

I am having a problem when enabling the DOM in Files & Images. I get the following error:

[Notice] Object of class AssetAdmin could not be converted to int
GET /admin/assets/

Line 121 in /disk1/web/vhost/

If I disable the DOM in Files & images it works fine.

SS v2.3.3
DOM r302
SWF r271




15 October 2009 at 1:20am Community Member, 51 Posts


I got today exactly the same problem. Have you found any solution how to resolve this problem (I mean without disabling of DOM..)?

Kind regards


15 October 2009 at 1:29am 4085 Posts

Hmm, I do see something that looks a little off. First, make sure that line 121 of your DataObjectManager.php is this:

$this->isNested = !$this->controller instanceof SiteTree && Controller::curr()== "CMSMain";

The problem seems to be that Controller::curr() returns an object, not a string. That line is trying to compare an object to a string.

I've updated the code to read:

$this->isNested = !$this->controller instanceof SiteTree && Controller::curr()->class == "CMSMain";

Update your SVN and let me know if that works.


15 October 2009 at 2:32am Community Member, 51 Posts

I updated DOM from SVN few minutes ago - it's works now!


Carbon Crayon

15 October 2009 at 3:22am Community Member, 598 Posts

Perfect as always UC :)

I don't think I've had a problem with the DOM that hasn't been fixed within a few hours! You should start charging for this kind of service ;)

Thanks again


16 October 2009 at 7:30pm Community Member, 43 Posts

Hi UncleCheese, after updating to DOM r303 I ran into problems. When I create a new ImageGallery the Album name is not shown in the pictures tab, and after uploading images they don't show up in the pictures tab also.

After changing back line 121 in dataobjectmanager.php to

$this->isNested = !$this->controller instanceof SiteTree && Controller::curr()== "CMSMain";

everything works fine again... so this last update seems to break something?