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
| Go to End | Next > | |
| Author | Topic: | 37899 Views |
-
Re: Bug Reports

15 June 2010 at 10:16am
@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.
-
Re: Bug Reports

15 June 2010 at 8:38pm
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:

-
Re: Bug Reports

16 June 2010 at 1:27am
Make sure the module is installed in the directory "dataobject_manager"
-
Re: Bug Reports

16 June 2010 at 5:06pm
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?
-
Re: Bug Reports

16 June 2010 at 7:05pm
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.
-
Re: Bug Reports

16 June 2010 at 8:17pm
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?
-
Re: Bug Reports

17 June 2010 at 11:52am
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
-
Re: Bug Reports

17 June 2010 at 5:53pm
If swfupload can upload files without a session, does that mean it's not authenticated in DataObjectManager?
| 37899 Views | ||
| Go to Top | Next > |



