Problem/Motivation
I want to be able to select Brandfolder Images from an Entity Browser view. I have created a Brandfolder Entity Browser and an Entity Browser view for Brandfolder images. See attached. When I select a Brandfolder Image in my content type, I get the following error:
The website encountered an unexpected error. Please try again later.
TypeError: brandfolder_map_media_entity_to_attachment(): Argument #1 ($media_entity_id) must be of type int, Drupal\media\Entity\Media given in brandfolder_map_media_entity_to_attachment() (line 1395 of modules/contrib/brandfolder/brandfolder.module).
array_walk(Array, 'brandfolder_map_media_entity_to_attachment') (Line: 156)
Drupal\brandfolder\Plugin\EntityBrowser\Widget\BrandfolderBrowser->getForm(Array, Object, Array) (Line: 177)
Drupal\entity_browser\Form\EntityBrowserForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('entity_browser_brandfolder_hero_entity_browser_form', Object) (Line: 375)
Drupal\Core\Form\FormBuilder->rebuildForm('entity_browser_brandfolder_hero_entity_browser_form', Object, Array) (Line: 633)
Drupal\Core\Form\FormBuilder->processForm('entity_browser_brandfolder_hero_entity_browser_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 44)
Drupal\redirect_after_login\RedirectMiddleware->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 53)
Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 124)
Drupal\cloudflare\CloudFlareMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Additional info:
- Brandfolder Image selection works as expected when I configure the Widget Section Plugin Settings > Selection Display Plugin = No selection display.
Brandfolder Image selection does nothing when I configure the Widget Section Plugin Settings > Selection Display Plugin = Multi-step selection display.