silverstripe-cloudassets icon indicating copy to clipboard operation
silverstripe-cloudassets copied to clipboard

Error: Upload File

Open MaGiOBooK opened this issue 8 years ago • 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?

MaGiOBooK avatar Apr 12 '16 10:04 MaGiOBooK

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.

robingram avatar May 16 '16 04:05 robingram

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

ryanbadger avatar Nov 28 '16 22:11 ryanbadger

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

joeherbert avatar Apr 22 '17 15:04 joeherbert

@joeherbert which version of SS are you using?

ryanbadger avatar Apr 22 '17 15:04 ryanbadger

@ryanbadger version 3.5

joeherbert avatar Apr 22 '17 15:04 joeherbert

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

ryanbadger avatar Apr 22 '17 15:04 ryanbadger

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.

joeherbert avatar Apr 22 '17 15:04 joeherbert