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

Multipul Uploadify


Go to End


1006 Views

Avatar
mattclegg

Community Member, 56 Posts

5 September 2010 at 10:22pm

Edited: 05/09/2010 10:25pm

Hey Uncle Cheese,

Great work on the new site, modules, screencasts & hat!

I tried using multipul Uploadifies on an Object and have;

class MyObject extends DataObject {
	static $has_many=array(
		'Images'=>'MyObject_Image',
		'Files'=>'MyObject_File'
	);

class MyObject_Image extends Image {
	static $has_one = array (
		'MyObject' => 'MyObject'
	);
}
class MyObject_File extends File {
	static $has_one = array (
		'MyObject' => 'MyObject'
	);
}

But the script woudn't load & firebug showed;
"Column 'ClassName' in where clause is ambiguous"

I changed line 341 of UploadifyField::importlist() to

$files = DataObject::get("File", "ParentID = $id AND \"File\".ClassName != 'Folder'");

And it worked!

Is that the right way to reference table names?