diff --git a/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionTrait.php b/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionTrait.php index 78c1b7e..a4b2c3f 100644 --- a/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionTrait.php +++ b/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionTrait.php @@ -57,23 +57,15 @@ * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. * @param \Drupal\Core\Render\RendererInterface $renderer - * The current renderer service. + * (optional) The current renderer service. */ - public function __construct( - array $configuration, - $plugin_id, - $plugin_definition, - EntityManagerInterface $entity_manager, - ModuleHandlerInterface $module_handler, - AccountInterface $current_user, - RendererInterface $renderer - ) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user, RendererInterface $renderer = NULL) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->entityManager = $entity_manager; $this->moduleHandler = $module_handler; $this->currentUser = $current_user; - $this->renderer = $renderer; + $this->renderer = $renderer ?: \Drupal::service('renderer'); } /**