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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Bug Reports


Go to End


297 Posts   102003 Views

Avatar
Mat Weir

Community Member, 33 Posts

1 June 2010 at 2:20pm

Hi UncleCheese,

I am using ImageDataObjectManager from trunk with SS 2.4. I have a Photo object that extends Image.

The manager is defined in Category.php as:

$manager = new ImageDataObjectManager(
$this,
'Photos',
'Photo',
null,
array('Title' => 'Title', 'Description' => 'Description', 'DateTaken' => 'DateTaken'),
'getCMSFields_forPopup');

I have a problem where OwnerID isn't being set on the File object. It seems that Member::currentUserID() is returning 0 in line 623 of FileDataObjectManager.php. This is strange, because of echo Member::currentUserID() from the CategoryController, it returns 1.

Have you experienced this problem with the latest versions?

Cheers,

Mat Weir

Avatar
UncleCheese

Forum Moderator, 4102 Posts

1 June 2010 at 3:14pm

ImageDOM manages DataObjects that contain images. Not images or subclasses thereof. Try ImageAssetManager.

Avatar
Mat Weir

Community Member, 33 Posts

1 June 2010 at 3:41pm

Thanks UncleCheese but I have the same problem with ImageAssetManager:

$manager = new ImageAssetManager(
	$this,
	'Photos',
	'Photo',
	array('Title' => 'Title', 'Description' => 'Description', 'DateTaken' => 'DateTaken')
);

OwnerID is set to 0 even though I'm logged in.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

1 June 2010 at 3:48pm

Does your Image subclass have a has_one relation to the page?

Avatar
Mat Weir

Community Member, 33 Posts

1 June 2010 at 3:54pm

Yes, and everything is working except OwnerID being set in the File table. Images are uploading and showing correctly related to the page.

Avatar
socks

Community Member, 191 Posts

7 June 2010 at 3:44pm

SS 2.3.6
SWFUpload r369 (I tried r375 too but that didn't seem to fix the issue)

This line in the swfupload/_config doesn't seem to be pulling from my php.ini and gives me a 20MB max upload warning:

'file_size_limit' => str_replace("M","MB",ini_get('upload_max_filesize')),

I did change swfupload/_config to this, which works, but would be nice if the other way worked too:

'file_size_limit' => '80MB',

Thank you

Avatar
UncleCheese

Forum Moderator, 4102 Posts

7 June 2010 at 4:52pm

What do you mean it's not pulling from php.ini? What value is being returned? Keep in mind that with most PHP configurations, it is not possible to modify upload_max_filesize with ini_set() or with htaccess directives.

Avatar
socks

Community Member, 191 Posts

8 June 2010 at 1:26pm

Well, in the past, using things like Slide Show Pro (on different host), I often had to upload a php.ini file to override the upload_max_filesize & post_max_size settings. It looks like the 20M value it's returning is the hosts default limit. So I guess my php.ini isn't really overriding.

Sorry for the false alarm.

Go to Top