- Issue created by @hemant-gupta
- 🇺🇸United States libgeek
The error message that comes back when selecting an image from BrandFolder is:
The website encountered an unexpected error. Try again later.
TypeError: file_validate(): Argument #1 ($file) must be of type Drupal\file\FileInterface, Drupal\media\Entity\Media given, called in /var/www/html/docroot/modules/contrib/entity_browser/src/Plugin/EntityBrowser/WidgetValidation/File.php on line 31 in file_validate() (line 97 of core/modules/file/file.module).
- Assigned to ndewhurst
- 🇺🇸United States ndewhurst USA
Hi hemant-gupta, thanks for filing this! As you observed, the module allows you to create new media types with Brandfolder images as their source, and then link those to any Drupal content entity via entity reference fields. That's the only currently supported field type for host entities, and the use case outlined in the README file is the only end-to-end use case currently supported.
The good news is (a) the module already has a good foundation to support direct use with Image fields, and (b) we've lined up some sponsorship & development time to add that functionality.
I'm reclassifying this as a feature request and will update it as we go!P.S. as for why users are allowed to try adding Brandfolder attachments to image fields using Entity Browser, even though those fields need File entities and the Brandfolder Entity Browser widget is only meant for Media entities, that's because (to my knowledge) there's no API via which Entity Browser widgets can declare the specific entity types they support so field widgets can limit the available options, etc. That's a known issue → outside the scope of this module.
- 🇺🇸United States ndewhurst USA
I'm expanding the scope to include broader support for Image fields - not just via Entity Browser