To reproduce

  1. Use latest dev versions from core and entity browser.
  2. Standard drupal install, enable entity_browser and ctools
  3. Create a 'Pages' view with an Entity browser display.
  4. At /admin/config/content/entity_browser create a 'Pages' browser with display.
  5. General information: Display plugin: "Modal", Widget selector plugin: "Single widget", Selection display plugin: "View selection display".
  6. Leave Display, Widget selector and Selection display as they are.
  7. On "Widgets" select the Pages view you created in 3. Click Finish.
  8. Add an Entity reference field to the Page content type with the above entity browser widget.
  9. Go to node/add/page and try to add a page entity. This error appears:
  10. Fatal error: Call to a member function getExecutable() on null in /modules/contrib/entity_browser/src/Plugin/EntityBrowser/SelectionDisplay/View.php on line 47
    Call Stack
    # Time Memory Function Location
    1 0.0001 239848 {main}( ) .../index.php:0
    2 0.0099 1950824 Drupal\Core\DrupalKernel->handle( ) .../index.php:19
    3 0.0258 4513032 Stack\StackedHttpKernel->handle( ) .../DrupalKernel.php:637
    4 0.0258 4513144 Drupal\Core\StackMiddleware\NegotiationMiddleware->handle( ) .../StackedHttpKernel.php:23
    5 0.0259 4513800 Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle( ) .../NegotiationMiddleware.php:55
    6 0.0259 4514232 Drupal\page_cache\StackMiddleware\PageCache->handle( ) .../ReverseProxyMiddleware.php:51
    7 0.0262 4524008 Drupal\page_cache\StackMiddleware\PageCache->pass( ) .../PageCache.php:82
    8 0.0262 4524088 Drupal\Core\StackMiddleware\KernelPreHandle->handle( ) .../PageCache.php:103
    9 0.0600 11106720 Drupal\Core\StackMiddleware\Session->handle( ) .../KernelPreHandle.php:53
    10 0.0632 11609904 Symfony\Component\HttpKernel\HttpKernel->handle( ) .../Session.php:62
    11 0.0632 11610856 Symfony\Component\HttpKernel\HttpKernel->handleRaw( ) .../HttpKernel.php:62
    12 0.1292 20817744 call_user_func_array:{/home/czigor/public_html/drupal8/vendor/symfony/http-kernel/HttpKernel.php:139} ( ) .../HttpKernel.php:139
    13 0.1292 20817944 Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}( ) .../HttpKernel.php:139
    14 0.1292 20818200 Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext( ) .../EarlyRenderingControllerWrapperSubscriber.php:102
    15 0.1293 20837576 Drupal\Core\Render\Renderer->executeInRenderContext( ) .../EarlyRenderingControllerWrapperSubscriber.php:129
    16 0.1293 20838024 Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}( ) .../Renderer.php:577
    17 0.1293 20838072 call_user_func_array:{/home/czigor/public_html/drupal8/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:128} ( ) .../EarlyRenderingControllerWrapperSubscriber.php:128
    18 0.1293 20838768 Drupal\Core\Controller\FormController->getContentResult( ) .../EarlyRenderingControllerWrapperSubscriber.php:128
    19 0.1326 21432208 Drupal\Core\Form\FormBuilder->buildForm( ) .../FormController.php:79
    20 0.1326 21433048 Drupal\Core\Form\FormBuilder->retrieveForm( ) .../FormBuilder.php:276
    21 0.1330 21495280 call_user_func_array:{/home/czigor/public_html/drupal8/core/lib/Drupal/Core/Form/FormBuilder.php:517} ( ) .../FormBuilder.php:517
    22 0.1330 21496168 Drupal\entity_browser\Form\EntityBrowserForm->buildForm( ) .../FormBuilder.php:517

Comments

czigor created an issue. See original summary.

boobaa’s picture

Issue summary: View changes

Confirmed that the issue is present as of 5dbf8abfb24a72663a241c190525f38dc87b2c59.

boobaa’s picture

Component: Widget plugins » Selection display plugins
Status: Active » Closed (duplicate)
Related issues: +#2671816: Implement configuration form for View selection display (to set View and View display)

The issue is present because there is no configuration form implemented yet for the View selection display. I'm marking this as a duplicate of #2671816: Implement configuration form for View selection display (to set View and View display).

szato’s picture

You can bypass this via config export/import

1. Export single item - Configuration type: Entity browser, Configuration name: [your entity browser]
2 .There will be under "widgets:"

     settings:
      view: null
      view_display: null

3 . Add your view and view display machine name, e.g.:

     settings:
      view: entity_browser
      view_display: entity_browser_lister

4. Import edited single configuration item - Configuration type: Entity browser

Unfortunetally on every editing (saving) of entity browser on UI will break it again.