Jump to:

7913 Posts in 1355 Topics by 930 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Bug Reports

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Go to End
Author Topic: 37899 Views
  • Mat Weir
    Avatar
    Community Member
    33 Posts

    Re: Bug Reports Link to this post

    @MarijnKampf, in Expert.php, try using:

    domPages = new ManyManyDataObjectManager($this->owner,
    ...

    As you're using a decorator, $this refers to the decorator, hence the DataObjectManager not being able to figure out the data class.

  • MarijnKampf
    Avatar
    Community Member
    150 Posts

    Re: Bug Reports Link to this post

    Thanks Mat that solved the error I was experiencing with the DOM module. I suspected it may have been a case of user error ;)

    Unfortunately, the css for the DOM isn't applied correctly:

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bug Reports Link to this post

    Make sure the module is installed in the directory "dataobject_manager"

  • Mat Weir
    Avatar
    Community Member
    33 Posts

    Re: Bug Reports Link to this post

    Hey UncleCheese, I asked you about this a few weeks ago and I'm still having trouble with it.

    In FileDataObjectManager.php line 623:

    $file->OwnerID = Member::currentUserID();


    The file's OwnerID isn't being set.

    After looking at Member::currentUserID I found that the session isn't working, $_SESSION is returning an empty array. But if I access the controller director $_SESSION has its normal data in it.

    I'm not familiar with how swfupload works, but I'm suspecting that perhaps the flash application that uploads the file has its own session (or no session?).

    What do you think?

  • MarcusDalgren
    Avatar
    Community Member
    287 Posts

    Re: Bug Reports Link to this post

    It's a known issue with SWFUpload that whatever session you happen to have active won't follow along unless you send in the session id as a variable and set the session yourself manually. I have no idea how messy this would be to setup in SilverStripe if it's possible at all since you have to do this before SilverStripe starts the session.

    Is there a reason for why you have to do this in the method that handles the swfupload though? Basically you have two chances to hit that file, once when it's actually uploaded by swfupload and you don't have session access and a second time when the form saves through $data['uploaded_files'] if you're using the field in a regular form. Right now I'm assuming you're using it outside of the CMS, inside the CMS I'm not sure when the best time is, onBeforeWrite() perhaps? Maybe you can grab it through $_REQUEST['uploaded_files'] then.

    Let me know if any of that helps. I use the method with $data['uploaded_files'] when I use SWFUploadField in my regular forms outside the CMS and it works great for me, never tried it in the CMS.

  • MarijnKampf
    Avatar
    Community Member
    150 Posts

    Re: Bug Reports Link to this post

    The module is installed in dataobject_manager, however, the DOM CSS code isn't being included in the source file. I tried including it in the init() member of the class Expert extends DataObjectDecorator, but this was ignored too.

    Is there a way to include additional CSS in the Security tab?

  • Mat Weir
    Avatar
    Community Member
    33 Posts

    Re: Bug Reports Link to this post

    Hi Smurkas,

    Thanks, I didn't know it was a known issue.

    I'm not doing anything out of the ordinary here in regards to DataObjectManager and I'm guessing that this has perhaps always been a bug in DataObjectManager.

    I've tried doing it onBeforeWrite(), but as it is still swfupload that has created the request, onBeforeWrite also suffers from the lack of session.

    I can't think of any way to get DataObjectManager to properly save the OwnerID other than to pass the session variable into swfupload like you've said, but I'm not sure how to do that.

    UncleCheese, do you agree that this is a bug in DOM?

    Cheers

  • Mat Weir
    Avatar
    Community Member
    33 Posts

    Re: Bug Reports Link to this post

    If swfupload can upload files without a session, does that mean it's not authenticated in DataObjectManager?

    37899 Views
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
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.