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.

All other Modules /

Discuss all other Modules here.

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

Can't attach files to DataObject if user profile language is not English


Go to End


4 Posts   751 Views

Avatar
GGast

Community Member, 2 Posts

21 February 2012 at 4:04am

Hi all,

I've run into some strange behaviour of (maybe) the Uploadify module. I've already ruled out the possibility of an issue with user rights.

I can upload files alright, but cannot attach them to a DataObject which is part of a page type. I can see the file to be attached in the Uploads folder and can select it, but can't save it ... UNLESS this user's profile language is set to English. If it's set to another language, no dice.

The structure of the DataObject is like this:

EventPage::has_many -> EventDataObject::has_many -> DownloadDataObject::has_one -> File

The has_one relationship of "File" and "DownloadDataObject" does not work, if the backend language is German.

Does anyone else have that problem and is there a known fix for it? :)

Thanks in advance!

Avatar
martimiz

Forum Moderator, 1391 Posts

21 February 2012 at 5:38am

Hi GGAst, welcome to the forums,

To eliminate that the error is caused by something in some German translation - have you tried using another profile language besides German and English?

Avatar
GGast

Community Member, 2 Posts

9 March 2012 at 11:28am

Hi martimiz,
I'll try that and get back to you. :) Thanks!

Avatar
swaiba

Forum Moderator, 1899 Posts

9 March 2012 at 11:05pm

Could well be that you need to add something like..

Object::add_extension('File', 'Translatable');

...as I recall when translatable is on and this isn't applied it will just add the file with the default locale instead of the current one.