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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Multipul Uploadify


Reply


723 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?