markguinn / silverstripe-cloudassets

Allows some or all of the assets folder to be located in a cloud storage container (S3, CloudFiles, etc.)
MIT License
19 stars 9 forks source link

Error: Upload File #29

Open MaGiOBooK opened 8 years ago

MaGiOBooK commented 8 years ago

Hi, when i try to upload file with $has_one 'VideoFile' => 'File' i've this error: Object->__call(): the method 'parent' does not exist on 'File'

How can i fix it?

robingram commented 8 years ago

I'm getting the same problem but on Image rather than File. The problem occurs on line 74 of Hierarchy.php. Maybe the Image instance has a ParentID set but no Parent attribute?

I'm assuming it is a missing attribute because Parent() is a magic method.

ryanbadger commented 7 years ago

I had this on all uploads in my site, I couldn't figure it out, so I just changed all instances of:

static $has_one = array( "Image" => "Image" );

to:

static $has_one = array(
"Image" => "CloudImage" );

and now my site runs fine

joeherbert commented 7 years ago

I'm experiencing this issue, and used @ryanbadger solution, which works great except for inline images and files. Any ideas?

ryanbadger commented 7 years ago

@joeherbert which version of SS are you using?

joeherbert commented 7 years ago

@ryanbadger version 3.5

ryanbadger commented 7 years ago

@joeherbert I think in the end I rolled back to a previous version.... there were too many problems otherwise

joeherbert commented 7 years ago

Alas I need 3.5 for other reasons, I will try to find a work around, I'm going to try to make CloudFile the default class used by the inline upload tool and see if that does the job, not pretty but I need this solved.