markguinn/silverstripe-cloudassets

Error: Upload File

Opened this issue · 7 comments

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?

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.

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

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

@joeherbert which version of SS are you using?

@ryanbadger version 3.5

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

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.