Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Files & Images broken when enabling DOM

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 1083 Views
  • Aram
    Avatar
    Community Member
    598 Posts

    Files & Images broken when enabling DOM Link to this post

    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/intranet.dev.mpc.local/html/dataobject_manager/code/DataObjectManager.php

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

    SS v2.3.3
    DOM r302
    SWF r271

    Thanks

    Aram

  • Digital-Punk.co.uk
    Avatar
    Community Member
    51 Posts

    Re: Files & Images broken when enabling DOM Link to this post

    Hi,

    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
    Mindaugas

  • UncleCheese
    Avatar
    4085 Posts

    Re: Files & Images broken when enabling DOM Link to this post

    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.

  • Digital-Punk.co.uk
    Avatar
    Community Member
    51 Posts

    Re: Files & Images broken when enabling DOM Link to this post

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

    kr
    Mindaugas

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Files & Images broken when enabling DOM Link to this post

    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

  • Platypus
    Avatar
    Community Member
    43 Posts

    Re: Files & Images broken when enabling DOM Link to this post

    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?

    1083 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.