View more context

 

bendubuisson

Can you elaborate please?

Show 1 attachment(s)
Damian Mooyman

Image dataobject gets constructed with a per-instance allowed extensions

Hide attachment content
tractorcow

Image's allowed_extension is a lot more restrictive

tractorcow

you can't, for instance, save an Image dataobject with a file.pdf

tractorcow
  1. public function __construct($record = null, $isSingleton = false, $queryParams = array())
  2. {
  3. parent::__construct($record, $isSingleton, $queryParams);
  4. $this->File->setAllowedCategories('image/supported');
  5. }
tractorcow

and $this->file->getAllowedExtensions() will map that image category to the list of extensions

bendubuisson

so to be clear, I am on the non Image DataObjects which has an image, when I upload the image, everything is fine, whgen I try to publish the DO, I get that error

tractorcow

yes but the error is coming from Image::validate()

tractorcow

At least, I am assuming this, based on what i've been told 😜