Commit dc6c7a4b authored by webchick's avatar webchick

Issue #1850792 by damiankloip, dawehner, tim.plunkett: Make init() method...

Issue #1850792 by damiankloip, dawehner, tim.plunkett: Make init() method consistent across all views plugins.
parent 532ea17f
......@@ -8,6 +8,7 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Core\Annotation\Plugin;
......@@ -24,10 +25,13 @@
class Comment extends FieldPluginBase {
/**
* Override init function to provide generic option to link to comment.
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*
* Provide generic option to link to comment.
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
if (!empty($this->options['link_to_comment'])) {
$this->additional_fields['cid'] = 'cid';
$this->additional_fields['nid'] = 'nid';
......
......@@ -8,6 +8,7 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\views\Plugin\views\field\Date;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\Core\Annotation\Plugin;
......@@ -26,8 +27,8 @@ class LastTimestamp extends Date {
/**
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->additional_fields['comment_count'] = 'comment_count';
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\views\Plugin\views\field\Numeric;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\Core\Annotation\Plugin;
......@@ -26,8 +27,8 @@ class NodeNewComments extends Numeric {
/**
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->additional_fields['nid'] = 'nid';
$this->additional_fields['type'] = 'type';
......
......@@ -8,6 +8,7 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Core\Annotation\Plugin;
......@@ -24,10 +25,13 @@
class Username extends FieldPluginBase {
/**
* Override init function to add uid and homepage fields.
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*
* Add uid and homepage fields.
*/
public function init(ViewExecutable $view, &$data) {
parent::init($view, $data);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->additional_fields['uid'] = 'uid';
$this->additional_fields['homepage'] = 'homepage';
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\field\Plugin\views\argument;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\argument\Numeric;
use Drupal\Core\Annotation\Plugin;
......@@ -31,8 +32,12 @@ class FieldList extends Numeric {
*/
var $allowed_values = NULL;
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
/**
* Overrides \Drupal\views\Plugin\views\argument\ArgumentPluginBase::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$field = field_info_field($this->definition['field_name']);
$this->allowed_values = options_allowed_values($field);
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\field\Plugin\views\argument;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\argument\String;
use Drupal\Core\Annotation\Plugin;
......@@ -31,8 +32,12 @@ class ListString extends String {
*/
var $allowed_values = NULL;
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
/**
* Overrides \Drupal\views\Plugin\views\argument\String::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$field = field_info_field($this->definition['field_name']);
$this->allowed_values = options_allowed_values($field);
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\field\Plugin\views\field;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Core\Annotation\Plugin;
......@@ -66,8 +67,11 @@ class Field extends FieldPluginBase {
*/
public $instance;
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->field_info = $field = field_info_field($this->definition['field_name']);
$this->multiple = FALSE;
......
......@@ -8,6 +8,7 @@
namespace Drupal\field\Plugin\views\relationship;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\relationship\RelationshipPluginBase;
use Drupal\Core\Annotation\Plugin;
......@@ -23,8 +24,11 @@
*/
class EntityReverse extends RelationshipPluginBase {
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
/**
* Overrides \Drupal\views\Plugin\views\relationship\RelationshipPluginBase::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->field_info = field_info_field($this->definition['field_name']);
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\file\Plugin\views\field;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\Core\Annotation\Plugin;
use Drupal\views\Plugin\views\field\FieldPluginBase;
......@@ -24,10 +25,11 @@
class File extends FieldPluginBase {
/**
* Constructor to provide additional field to add.
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
if (!empty($options['link_to_file'])) {
$this->additional_fields['uri'] = 'uri';
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\node\Plugin\views\field;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\node\Plugin\views\field\Node;
use Drupal\Core\Annotation\Plugin;
......@@ -26,8 +27,12 @@
*/
class HistoryUserTimestamp extends Node {
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
/**
* Overrides \Drupal\node\Plugin\views\field\Node::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
global $user;
if ($user->uid) {
$this->additional_fields['created'] = array('table' => 'node', 'field' => 'created');
......
......@@ -8,6 +8,7 @@
namespace Drupal\node\Plugin\views\field;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Core\Annotation\Plugin;
......@@ -25,8 +26,12 @@
*/
class Node extends FieldPluginBase {
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
// Don't add the additional fields to groupby
if (!empty($this->options['link_to_node'])) {
$this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid');
......
......@@ -8,6 +8,7 @@
namespace Drupal\node\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\Core\Annotation\Plugin;
......@@ -24,10 +25,10 @@
class Path extends FieldPluginBase {
/**
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->additional_fields['nid'] = 'nid';
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\node\Plugin\views\field;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\node\Plugin\views\field\Node;
use Drupal\Core\Annotation\Plugin;
......@@ -23,8 +24,12 @@
*/
class Revision extends Node {
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
/**
* Overrides \Drupal\node\Plugin\views\field\Node::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
if (!empty($this->options['link_to_node_revision'])) {
$this->additional_fields['vid'] = 'vid';
$this->additional_fields['nid'] = 'nid';
......
......@@ -8,6 +8,7 @@
namespace Drupal\node\Plugin\views\field;
use Drupal\node\Plugin\views\field\Link;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\Core\Annotation\Plugin;
......@@ -26,8 +27,8 @@ class RevisionLink extends Link {
/**
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->additional_fields['node_vid'] = array('table' => 'node_revision', 'field' => 'vid');
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\system\Plugin\views\row;
use Drupal\views\Plugin\views\row\RowPluginBase;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
/**
......@@ -51,12 +52,12 @@ class EntityRow extends RowPluginBase {
protected $build = array();
/**
* Overrides Drupal\views\Plugin\views\row\RowPluginBase::init().
* Overrides Drupal\views\Plugin\views\PluginBase::init().
*/
public function init(ViewExecutable $view, &$display, $options = NULL) {
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->entityType = $this->definition['entity_type'];
$this->entityType = $this->definition['entity_type'];
$this->entityInfo = entity_get_info($this->entityType);
$this->base_table = $this->entityInfo['base_table'];
$this->base_field = $this->entityInfo['entity_keys']['id'];
......
......@@ -8,6 +8,7 @@
namespace Drupal\taxonomy\Plugin\views\argument_default;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\Core\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase;
......@@ -23,8 +24,22 @@
*/
class Tid extends ArgumentDefaultPluginBase {
public function init(ViewExecutable $view, &$argument, $options) {
parent::init($view, $argument, $options);
/**
* Overrides \Drupal\views\Plugin\views\Plugin\views\PluginBase::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
// @todo Remove the legacy code.
// Convert legacy vids option to machine name vocabularies.
if (!empty($this->options['vids'])) {
$vocabularies = taxonomy_vocabulary_get_names();
foreach ($this->options['vids'] as $vid) {
if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
$this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
}
}
}
}
protected function defineOptions() {
......
......@@ -8,6 +8,7 @@
namespace Drupal\taxonomy\Plugin\views\argument_validator;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\Core\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
use Drupal\views\Plugin\views\argument_validator\ArgumentValidatorPluginBase;
......@@ -23,8 +24,22 @@
*/
class Term extends ArgumentValidatorPluginBase {
public function init(ViewExecutable $view, &$argument, $options) {
parent::init($view, $argument, $options);
/**
* Overrides \Drupal\views\Plugin\views\Plugin\views\PluginBase::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
// @todo Remove the legacy code.
// Convert legacy vids option to machine name vocabularies.
if (!empty($this->options['vids'])) {
$vocabularies = taxonomy_vocabulary_get_names();
foreach ($this->options['vids'] as $vid) {
if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
$this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
}
}
}
}
protected function defineOptions() {
......
......@@ -8,6 +8,7 @@
namespace Drupal\taxonomy\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\Core\Annotation\Plugin;
......@@ -26,8 +27,8 @@ class LinkEdit extends FieldPluginBase {
/**
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->additional_fields['tid'] = 'tid';
$this->additional_fields['vid'] = 'vid';
......
......@@ -8,6 +8,7 @@
namespace Drupal\taxonomy\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\Core\Annotation\Plugin;
......@@ -32,8 +33,8 @@ class Taxonomy extends FieldPluginBase {
* This method assumes the taxonomy_term_data table. If using another table,
* we'll need to be more specific.
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->additional_fields['vid'] = 'vid';
$this->additional_fields['tid'] = 'tid';
......
......@@ -8,6 +8,7 @@
namespace Drupal\taxonomy\Plugin\views\field;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\field\PrerenderList;
use Drupal\Core\Annotation\Plugin;
......@@ -23,8 +24,12 @@
*/
class TaxonomyIndexTid extends PrerenderList {
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
/**
* Overrides \Drupal\views\Plugin\views\field\PrerenderList::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
// @todo: Wouldn't it be possible to use $this->base_table and no if here?
if ($view->storage->get('base_table') == 'node_revision') {
$this->additional_fields['nid'] = array('table' => 'node_revision', 'field' => 'nid');
......
......@@ -8,6 +8,7 @@
namespace Drupal\taxonomy\Plugin\views\filter;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\Core\Annotation\Plugin;
use Drupal\views\Plugin\views\filter\ManyToOne;
......@@ -26,8 +27,12 @@ class TaxonomyIndexTid extends ManyToOne {
// Stores the exposed input for this filter.
var $validated_exposed_input = NULL;
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
/**
* Overrides \Drupal\views\Plugin\views\filter\ManyToOne::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
if (!empty($this->definition['vocabulary'])) {
$this->options['vid'] = $this->definition['vocabulary'];
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\taxonomy\Plugin\views\relationship;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\relationship\RelationshipPluginBase;
use Drupal\Core\Annotation\Plugin;
......@@ -23,8 +24,22 @@
*/
class NodeTermData extends RelationshipPluginBase {
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
/**
* Overrides \Drupal\views\Plugin\views\relationship\RelationshipPluginBase::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
// @todo Remove the legacy code.
// Convert legacy vids option to machine name vocabularies.
if (!empty($this->options['vids'])) {
$vocabularies = taxonomy_vocabulary_get_names();
foreach ($this->options['vids'] as $vid) {
if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
$this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
}
}
}
}
protected function defineOptions() {
......
......@@ -8,6 +8,7 @@
namespace Drupal\user\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Annotation\Plugin;
......@@ -27,8 +28,8 @@ class Link extends FieldPluginBase {
/**
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->additional_fields['uid'] = 'uid';
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\user\Plugin\views\field;
use Drupal\user\Plugin\views\field\User;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\Core\Annotation\Plugin;
use Drupal\views\ViewExecutable;
......@@ -24,10 +25,13 @@
class Name extends User {
/**
* Overrides \Drupal\user\Plugin\views\field\User::init().
*
* Add uid in the query so we can test for anonymous if needed.
*/
public function init(ViewExecutable $view, &$data) {
parent::init($view, $data);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
if (!empty($this->options['overwrite_anonymous']) || !empty($this->options['format_username'])) {
$this->additional_fields['uid'] = 'uid';
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\user\Plugin\views\field;
use Drupal\Core\Annotation\Plugin;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\field\PrerenderList;
......@@ -26,8 +27,8 @@ class Permissions extends PrerenderList {
/**
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->additional_fields['uid'] = array('table' => 'users', 'field' => 'uid');
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\user\Plugin\views\field;
use Drupal\Core\Annotation\Plugin;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\field\PrerenderList;
......@@ -26,8 +27,8 @@ class Roles extends PrerenderList {
/**
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->additional_fields['uid'] = array('table' => 'users', 'field' => 'uid');
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\user\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\Core\Annotation\Plugin;
use Drupal\views\ViewExecutable;
......@@ -24,10 +25,11 @@
class User extends FieldPluginBase {
/**
* Override init function to provide generic option to link to user.
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*/
public function init(ViewExecutable $view, &$data) {
parent::init($view, $data);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
if (!empty($this->options['link_to_user'])) {
$this->additional_fields['uid'] = 'uid';
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\user\Plugin\views\filter;
use Drupal\Core\Annotation\Plugin;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\filter\BooleanOperator;
......@@ -26,8 +27,8 @@ class Current extends BooleanOperator {
/**
* Overrides Drupal\views\Plugin\views\filter\BooleanOperator::init().
*/
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->value_value = t('Is the logged in user');
}
......
......@@ -80,7 +80,7 @@ protected function initializeDisplay($display_id) {
$this->displayHandlers[$display_id] = drupal_container()->get("plugin.manager.views.display")->createInstance('default');
}
$this->displayHandlers[$display_id]->init($this->view, $display);
$this->displayHandlers[$display_id]->initDisplay($this->view, $display);
// If this is not the default display handler, let it know which is since
// it may well utilize some data from the default.
if ($display_id != 'default') {
......
......@@ -8,6 +8,7 @@
namespace Drupal\views\Plugin\views;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\PluginBase;
use Drupal\views\ViewExecutable;
use Drupal\Core\Database\Database;
......@@ -80,17 +81,11 @@ public function __construct(array $configuration, $plugin_id, DiscoveryInterface
}
/**
* Init the handler with necessary data.