diff --git a/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlockBase.php b/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlockBase.php index 628ae58..5f32f15 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlockBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlockBase.php @@ -41,7 +41,14 @@ protected $displaySet; /** - * Constructs a Drupal\Component\Plugin\PluginBase object. + * The current user. + * + * @var \Drupal\Core\Session\AccountInterface + */ + protected $user; + + /** + * Constructs a \Drupal\views\Plugin\Block\ViewsBlockBase object. * * @param array $configuration * A configuration array containing information about the plugin instance. @@ -53,8 +60,10 @@ * The view executable factory. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller * The views storage controller. + * @param \Drupal\Core\Session\AccountInterface $user + * The current user. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, ViewExecutableFactory $executable_factory, EntityStorageControllerInterface $storage_controller) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, ViewExecutableFactory $executable_factory, EntityStorageControllerInterface $storage_controller, AccountInterface $user) { $this->pluginId = $plugin_id; list($plugin, $delta) = explode(':', $this->getPluginId()); list($name, $this->displayID) = explode('-', $delta, 2); @@ -62,6 +71,7 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi $view = $storage_controller->load($name); $this->view = $executable_factory->get($view); $this->displaySet = $this->view->setDisplay($this->displayID); + $this->user = $user; parent::__construct($configuration, $plugin_id, $plugin_definition); } @@ -73,7 +83,8 @@ public static function create(ContainerInterface $container, array $configuratio return new static( $configuration, $plugin_id, $plugin_definition, $container->get('views.executable'), - $container->get('entity.manager')->getStorageController('view') + $container->get('entity.manager')->getStorageController('view'), + $container->get('current_user') ); } @@ -128,19 +139,6 @@ public function buildConfigurationForm(array $form, array &$form_state) { ), ); - $form['views_label_warning'] = array( - '#markup' => $this->t('