diff --git a/lib/Drupal/views/Plugin/views/PluginBase.php b/lib/Drupal/views/Plugin/views/PluginBase.php index ba56409768529603efeacb1d68a06b8bf6dc0032..8262412797415a6bf3574f5d9560a7e523260f5e 100644 --- a/lib/Drupal/views/Plugin/views/PluginBase.php +++ b/lib/Drupal/views/Plugin/views/PluginBase.php @@ -47,8 +47,6 @@ public function __construct(array $configuration, $plugin_id, DiscoveryInterface parent::__construct($configuration, $plugin_id, $discovery); $this->definition = $this->discovery->getDefinition($plugin_id) + $configuration; - - $this->construct(); } /** @@ -69,13 +67,6 @@ public function __construct(array $configuration, $plugin_id, DiscoveryInterface */ protected function defineOptions() { return array(); } - /** - * Views handlers use a special construct function so that we can more - * easily construct them with variable arguments. - */ - public function construct() { - } - protected function setOptionDefaults(&$storage, $options, $level = 0) { foreach ($options as $option => $definition) { if (isset($definition['contains']) && is_array($definition['contains'])) { diff --git a/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php b/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php index b8f00a1cad59e6c30b9367f728d72926c6de714a..d4964f75951e12140d062b3e1448eae838189c47 100644 --- a/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php +++ b/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\PluginBase; use Drupal\views\Plugin\views\HandlerBase; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * @defgroup views_argument_handlers Views argument handlers @@ -61,10 +62,10 @@ abstract class ArgumentPluginBase extends HandlerBase { var $name_field; /** - * Constructor + * Constructs a ArgumentPluginBase object. */ - public function construct() { - parent::construct(); + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); if (!empty($this->definition['name field'])) { $this->name_field = $this->definition['name field']; diff --git a/lib/Drupal/views/Plugin/views/argument/Formula.php b/lib/Drupal/views/Plugin/views/argument/Formula.php index 746477373c4a56abc4756b5f552212e832453125..bdc065bd6a5ca5098aee3f39c3a290407d29e979 100644 --- a/lib/Drupal/views/Plugin/views/argument/Formula.php +++ b/lib/Drupal/views/Plugin/views/argument/Formula.php @@ -8,6 +8,7 @@ namespace Drupal\views\Plugin\views\argument; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Abstract argument handler for simple formulae. @@ -28,10 +29,10 @@ class Formula extends ArgumentPluginBase { var $formula = NULL; /** - * Constructor + * Constructs a Formula object. */ - public function construct() { - parent::construct(); + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); if (!empty($this->definition['formula'])) { $this->formula = $this->definition['formula']; diff --git a/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php index 1c83039a3d79461d260df0c4e31275dd5b57979a..0726c28c900fc9f4cadccdeb3ad4c4ff20ba0682 100644 --- a/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php +++ b/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\HandlerBase; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * @defgroup views_field_handlers Views field handlers @@ -67,10 +68,10 @@ abstract class FieldPluginBase extends HandlerBase { var $additional_fields = array(); /** - * Construct a new field handler. + * Constructs a FieldPluginBase object. */ - public function construct() { - parent::construct(); + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); $this->additional_fields = array(); if (!empty($this->definition['additional fields'])) { diff --git a/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php b/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php index d924a8444538865b689e3368299452cdbe36fd00..de3cdf05a276486ab05f910763a78c844e1181dc 100644 --- a/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php +++ b/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php @@ -8,6 +8,7 @@ namespace Drupal\views\Plugin\views\filter; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Simple filter to handle matching of boolean values @@ -38,7 +39,12 @@ class BooleanOperator extends FilterPluginBase { // Whether to accept NULL as a false value or not var $accept_null = FALSE; - public function construct() { + /** + * Constructs a BooleanOperator object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->value_value = t('True'); if (isset($this->definition['label'])) { $this->value_value = $this->definition['label']; @@ -50,7 +56,6 @@ public function construct() { $this->accept_null = (bool) $this->definition['accept_null']; } $this->value_options = NULL; - parent::construct(); } /** diff --git a/lib/Drupal/views/Plugin/views/filter/InOperator.php b/lib/Drupal/views/Plugin/views/filter/InOperator.php index 929b719645ddab7ab521ed3a12d0769bb0ccd0da..f622373fb5a9d6a15cfaa041aaabb2281d1b5c3a 100644 --- a/lib/Drupal/views/Plugin/views/filter/InOperator.php +++ b/lib/Drupal/views/Plugin/views/filter/InOperator.php @@ -8,6 +8,7 @@ namespace Drupal\views\Plugin\views\filter; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Simple filter to handle matching of multiple options selectable via checkboxes @@ -32,8 +33,12 @@ class InOperator extends FilterPluginBase { */ var $value_options = NULL; - public function construct() { - parent::construct(); + /** + * Constructs a BooleanOperator object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->value_title = t('Options'); $this->value_options = NULL; } diff --git a/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php index d0deb5edd3cf6d201c35a885311ec03275afa605..6949f483d53ac8d51a64ed0bfb7539f88b74a61c 100644 --- a/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +++ b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php @@ -11,6 +11,7 @@ use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\PluginBase; use Drupal\views\Plugin\views\wizard\WizardInterface; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Provides the interface and base class for Views Wizard plugins. @@ -108,12 +109,11 @@ abstract class WizardPluginBase extends PluginBase implements WizardInterface { ); /** - * Constructs the WizardPluginBase object. - * - * @param array $definition - * The information stored in the annotation definition. + * Constructs a WizardPluginBase object. */ - function construct() { + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->base_table = $this->definition['base_table']; $entities = entity_get_info(); diff --git a/lib/Views/aggregator/Plugin/views/field/Category.php b/lib/Views/aggregator/Plugin/views/field/Category.php index 493e3065ae784af4062e48ed6e5cbe78d7147dfb..211c1e8a959b535f4052180874b31668e28810c5 100644 --- a/lib/Views/aggregator/Plugin/views/field/Category.php +++ b/lib/Views/aggregator/Plugin/views/field/Category.php @@ -24,10 +24,11 @@ class Category extends FieldPluginBase { /** - * Constructor to provide additional field to add. + * Constructs a Category object. */ - public function construct() { - parent::construct(); + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['cid'] = 'cid'; } diff --git a/lib/Views/aggregator/Plugin/views/field/TitleLink.php b/lib/Views/aggregator/Plugin/views/field/TitleLink.php index 10e19ef6942c78e388b202f254bd2e7201c9547e..f38fe15ea73bb5060570d97ac9bf2154cd4b5f70 100644 --- a/lib/Views/aggregator/Plugin/views/field/TitleLink.php +++ b/lib/Views/aggregator/Plugin/views/field/TitleLink.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler that turns an item's title into a clickable link to the original @@ -23,8 +24,12 @@ */ class TitleLink extends FieldPluginBase { - public function construct() { - parent::construct(); + /** + * Constructs a Category object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['link'] = 'link'; } diff --git a/lib/Views/comment/Plugin/views/field/LastTimestamp.php b/lib/Views/comment/Plugin/views/field/LastTimestamp.php index 18bb0f61ac4abfe2793626baafc39236b0d5a7e3..a64bceff599591a61cd780b04558c6e505a83fbe 100644 --- a/lib/Views/comment/Plugin/views/field/LastTimestamp.php +++ b/lib/Views/comment/Plugin/views/field/LastTimestamp.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\field\Date; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to display the timestamp of a comment with the count of comments. @@ -22,8 +23,12 @@ */ class LastTimestamp extends Date { - public function construct() { - parent::construct(); + /** + * Constructs a LastTimestamp object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['comment_count'] = 'comment_count'; } diff --git a/lib/Views/comment/Plugin/views/field/NodeNewComments.php b/lib/Views/comment/Plugin/views/field/NodeNewComments.php index 813979ece829c19fb1825c5470cc664e23f46f7d..fc0cad678f361527d59672bfe3ffd50cfd93c85b 100644 --- a/lib/Views/comment/Plugin/views/field/NodeNewComments.php +++ b/lib/Views/comment/Plugin/views/field/NodeNewComments.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\field\Numeric; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to display the number of new comments. @@ -22,8 +23,12 @@ */ class NodeNewComments extends Numeric { - public function construct() { - parent::construct(); + /** + * Constructs a NodeNewComments object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['nid'] = 'nid'; $this->additional_fields['type'] = 'type'; $this->additional_fields['comment_count'] = array('table' => 'node_comment_statistics', 'field' => 'comment_count'); diff --git a/lib/Views/filter/Plugin/views/field/FormatName.php b/lib/Views/filter/Plugin/views/field/FormatName.php index 0c26092fd550e5acd18e6be6e024ec8997ca714e..18c1afbe98b9e2fcb04a5bef9dc732777c08ef15 100644 --- a/lib/Views/filter/Plugin/views/field/FormatName.php +++ b/lib/Views/filter/Plugin/views/field/FormatName.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to output the name of an input format. @@ -22,8 +23,12 @@ */ class FormatName extends FieldPluginBase { - public function construct() { - parent::construct(); + /** + * Constructs a FormatName object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + // Be explicit about the table we are using. $this->additional_fields['name'] = array('table' => 'filter_formats', 'field' => 'name'); } diff --git a/lib/Views/locale/Plugin/views/field/LinkEdit.php b/lib/Views/locale/Plugin/views/field/LinkEdit.php index 2fe9a7aa4bed524cf7757276dd488f03fc3f778a..afc3eeb88213139ef555dddbbe8c15406dc81552 100644 --- a/lib/Views/locale/Plugin/views/field/LinkEdit.php +++ b/lib/Views/locale/Plugin/views/field/LinkEdit.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to present a link to edit a translation. @@ -22,8 +23,12 @@ */ class LinkEdit extends FieldPluginBase { - public function construct() { - parent::construct(); + /** + * Constructs a LinkEdit object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['lid'] = 'lid'; } diff --git a/lib/Views/node/Plugin/views/argument/CreatedDay.php b/lib/Views/node/Plugin/views/argument/CreatedDay.php index 4dee19c8effe23dc48f7bb7a4ad56be41954cc40..2d2b7cc884c824e2bbc5dfea134ba8f6ad0375fb 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedDay.php +++ b/lib/Views/node/Plugin/views/argument/CreatedDay.php @@ -9,6 +9,7 @@ use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\argument\Date; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Argument handler for a day (DD) @@ -21,10 +22,11 @@ class CreatedDay extends Date { /** - * Constructor implementation + * Constructs a CreatedDay object. */ - public function construct() { - parent::construct(); + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->formula = views_date_sql_extract('DAY', "***table***.$this->realField"); $this->format = 'j'; $this->arg_format = 'd'; diff --git a/lib/Views/node/Plugin/views/argument/CreatedFullDate.php b/lib/Views/node/Plugin/views/argument/CreatedFullDate.php index 57caafb896d7bd6cc85121f2b7871ec5aed22f90..934b67ea9b9b55bb1e779d625de790cb91c0636d 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedFullDate.php +++ b/lib/Views/node/Plugin/views/argument/CreatedFullDate.php @@ -9,6 +9,7 @@ use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\argument\Date; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Argument handler for a full date (CCYYMMDD) @@ -21,10 +22,11 @@ class CreatedFullDate extends Date { /** - * Constructor implementation + * Constructs a CreatedFullDate object. */ - public function construct() { - parent::construct(); + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->format = 'F j, Y'; $this->arg_format = 'Ymd'; $this->formula = views_date_sql_format($this->arg_format, "***table***.$this->realField"); diff --git a/lib/Views/node/Plugin/views/argument/CreatedMonth.php b/lib/Views/node/Plugin/views/argument/CreatedMonth.php index 3eb5b9dddb77c06e929280241bb6529d985241af..ed51d2080747514c9fb177382becbda4b0afb61d 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedMonth.php +++ b/lib/Views/node/Plugin/views/argument/CreatedMonth.php @@ -9,6 +9,7 @@ use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\argument\Date; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Argument handler for a month (MM) @@ -21,10 +22,11 @@ class CreatedMonth extends Date { /** - * Constructor implementation + * Constructs a CreatedMonth object. */ - public function construct() { - parent::construct(); + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->formula = views_date_sql_extract('MONTH', "***table***.$this->realField"); $this->format = 'F'; $this->arg_format = 'm'; diff --git a/lib/Views/node/Plugin/views/argument/CreatedWeek.php b/lib/Views/node/Plugin/views/argument/CreatedWeek.php index 9e1f4656f60fcd2d0407b13162a805e7b7b45d7e..9e5475848e8bb95f87aab4c2300c87bc10fa8557 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedWeek.php +++ b/lib/Views/node/Plugin/views/argument/CreatedWeek.php @@ -9,6 +9,7 @@ use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\argument\Date; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Argument handler for a week. @@ -21,10 +22,11 @@ class CreatedWeek extends Date { /** - * Constructor implementation + * Constructs a CreatedWeek object. */ - public function construct() { - parent::construct(); + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->arg_format = 'w'; $this->formula = views_date_sql_extract('WEEK', "***table***.$this->realField"); } diff --git a/lib/Views/node/Plugin/views/argument/CreatedYear.php b/lib/Views/node/Plugin/views/argument/CreatedYear.php index fc0b56450d6a9ef79f93d9e7c9844bd9b0ebe72b..55d4cf779054abd01c0959b08628bb1509eba40a 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedYear.php +++ b/lib/Views/node/Plugin/views/argument/CreatedYear.php @@ -9,6 +9,7 @@ use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\argument\Date; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Argument handler for a year (CCYY) @@ -21,10 +22,11 @@ class CreatedYear extends Date { /** - * Constructor implementation + * Constructs a CreatedYear object. */ - public function construct() { - parent::construct(); + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->arg_format = 'Y'; $this->formula = views_date_sql_extract('YEAR', "***table***.$this->realField"); } diff --git a/lib/Views/node/Plugin/views/argument/CreatedYearMonth.php b/lib/Views/node/Plugin/views/argument/CreatedYearMonth.php index 79aa3a4b024b94cf0cf1a1c3b5a947d9c08df54c..758f3d78b29b8eeae2fcfaeddadb2f982a5ff905 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedYearMonth.php +++ b/lib/Views/node/Plugin/views/argument/CreatedYearMonth.php @@ -9,6 +9,7 @@ use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\argument\Date; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Argument handler for a year plus month (CCYYMM) @@ -21,10 +22,11 @@ class CreatedYearMonth extends Date { /** - * Constructor implementation + * Constructs a CreatedYearMonth object. */ - public function construct() { - parent::construct(); + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->format = 'F Y'; $this->arg_format = 'Ym'; $this->formula = views_date_sql_format($this->arg_format, "***table***.$this->realField"); diff --git a/lib/Views/node/Plugin/views/argument/Type.php b/lib/Views/node/Plugin/views/argument/Type.php index 370fa0206f06870e4bc4bea268a6332cdbc747f1..092bb233873cecb8754c60d2f67cfb5b54c3a61b 100644 --- a/lib/Views/node/Plugin/views/argument/Type.php +++ b/lib/Views/node/Plugin/views/argument/Type.php @@ -20,10 +20,6 @@ */ class Type extends String { - public function construct() { - parent::construct('type'); - } - /** * Override the behavior of summary_name(). Get the user friendly version * of the node type. diff --git a/lib/Views/node/Plugin/views/field/Path.php b/lib/Views/node/Plugin/views/field/Path.php index 3f95eb38d22495904c355e6e382a887ee2987757..8cb2bf666c9790b346f422392fed04b7894625d0 100644 --- a/lib/Views/node/Plugin/views/field/Path.php +++ b/lib/Views/node/Plugin/views/field/Path.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to present the path to the node. @@ -22,6 +23,15 @@ */ class Path extends FieldPluginBase { + /** + * Constructs a Path object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + + $this->additional_fields['nid'] = 'nid'; + } + protected function defineOptions() { $options = parent::defineOptions(); $options['absolute'] = array('default' => FALSE, 'bool' => TRUE); @@ -29,11 +39,6 @@ protected function defineOptions() { return $options; } - public function construct() { - parent::construct(); - $this->additional_fields['nid'] = 'nid'; - } - public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); $form['absolute'] = array( diff --git a/lib/Views/node/Plugin/views/field/RevisionLink.php b/lib/Views/node/Plugin/views/field/RevisionLink.php index bd892df982df6655946e3bbb720e195f5f9c7e79..a8aaceb9895492c7f9745e1de00c370de10c4578 100644 --- a/lib/Views/node/Plugin/views/field/RevisionLink.php +++ b/lib/Views/node/Plugin/views/field/RevisionLink.php @@ -9,6 +9,7 @@ use Views\node\Plugin\views\field\Link; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to present a link to a node revision. @@ -22,8 +23,12 @@ */ class RevisionLink extends Link { - public function construct() { - parent::construct(); + /** + * Constructs a RevisionLink object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['node_vid'] = array('table' => 'node_revision', 'field' => 'vid'); } diff --git a/lib/Views/taxonomy/Plugin/views/field/LinkEdit.php b/lib/Views/taxonomy/Plugin/views/field/LinkEdit.php index e6ddf1db1f6e73780b9c70b295b0d42447cc4489..a6b3c4079f593db370a785b0ed8c3b14c58bf4ff 100644 --- a/lib/Views/taxonomy/Plugin/views/field/LinkEdit.php +++ b/lib/Views/taxonomy/Plugin/views/field/LinkEdit.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to present a term edit link. @@ -22,8 +23,12 @@ */ class LinkEdit extends FieldPluginBase { - public function construct() { - parent::construct(); + /** + * Constructs a LinkEdit object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['tid'] = 'tid'; $this->additional_fields['vid'] = 'vid'; $this->additional_fields['vocabulary_machine_name'] = array( diff --git a/lib/Views/taxonomy/Plugin/views/field/Taxonomy.php b/lib/Views/taxonomy/Plugin/views/field/Taxonomy.php index e5595f135f3fdee127c19558c15ff5f66bbc26d5..74f8552881f6058b93b6ae1c60153d7cd2508ea2 100644 --- a/lib/Views/taxonomy/Plugin/views/field/Taxonomy.php +++ b/lib/Views/taxonomy/Plugin/views/field/Taxonomy.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface;; /** * Field handler to provide simple renderer that allows linking to a taxonomy @@ -26,13 +27,14 @@ class Taxonomy extends FieldPluginBase { /** - * Constructor to provide additional field to add. + * Constructs a Taxonomy object. * * This constructer assumes the taxonomy_term_data table. If using another * table, we'll need to be more specific. */ - public function construct() { - parent::construct(); + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['vid'] = 'vid'; $this->additional_fields['tid'] = 'tid'; $this->additional_fields['vocabulary_machine_name'] = array( diff --git a/lib/Views/translation/Plugin/views/field/NodeTranslationLink.php b/lib/Views/translation/Plugin/views/field/NodeTranslationLink.php index ac82893d74325959cf4eeb645dfb946426eb1afb..4ecd2886665d84c8a5f6efcef9a4913480cba7a7 100644 --- a/lib/Views/translation/Plugin/views/field/NodeTranslationLink.php +++ b/lib/Views/translation/Plugin/views/field/NodeTranslationLink.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to present a link to the node. @@ -22,8 +23,12 @@ */ class NodeTranslationLink extends FieldPluginBase { - public function construct() { - parent::construct(); + /** + * Constructs a NodeTranslationLink object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['nid'] = 'nid'; $this->additional_fields['tnid'] = 'tnid'; $this->additional_fields['title'] = 'title'; diff --git a/lib/Views/user/Plugin/views/field/Link.php b/lib/Views/user/Plugin/views/field/Link.php index ea42fe67f9910dfec9d3c1a37fed7bb0458bc1b9..c310e9155e238c8f6376bfea04afbde0c95ed40f 100644 --- a/lib/Views/user/Plugin/views/field/Link.php +++ b/lib/Views/user/Plugin/views/field/Link.php @@ -9,6 +9,7 @@ use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\Core\Annotation\Plugin; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to present a link to the user. @@ -22,8 +23,12 @@ */ class Link extends FieldPluginBase { - public function construct() { - parent::construct(); + /** + * Constructs a Link object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['uid'] = 'uid'; } diff --git a/lib/Views/user/Plugin/views/field/Permissions.php b/lib/Views/user/Plugin/views/field/Permissions.php index 08ab1332d4bc8b0bd19b5793c39692f0e87102d3..4036520d3386d4ffbd1538ac6effb18ffa201fc3 100644 --- a/lib/Views/user/Plugin/views/field/Permissions.php +++ b/lib/Views/user/Plugin/views/field/Permissions.php @@ -9,6 +9,7 @@ use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\field\PrerenderList; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to provide a list of permissions. @@ -22,8 +23,12 @@ */ class Permissions extends PrerenderList { - public function construct() { - parent::construct(); + /** + * Constructs a Permissions object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['uid'] = array('table' => 'users', 'field' => 'uid'); } diff --git a/lib/Views/user/Plugin/views/field/Picture.php b/lib/Views/user/Plugin/views/field/Picture.php index 9242f00552d864601c1bac670f451f9448f3e3b3..764f1d7a788f618467b8894bbb43cb37b52c539c 100644 --- a/lib/Views/user/Plugin/views/field/Picture.php +++ b/lib/Views/user/Plugin/views/field/Picture.php @@ -9,6 +9,7 @@ use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\field\FieldPluginBase; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to provide simple renderer that allows using a themed user link. @@ -22,8 +23,12 @@ */ class Picture extends FieldPluginBase { - public function construct() { - parent::construct(); + /** + * Constructs a Picture object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['uid'] = 'uid'; $this->additional_fields['name'] = 'name'; $this->additional_fields['mail'] = 'mail'; diff --git a/lib/Views/user/Plugin/views/field/Roles.php b/lib/Views/user/Plugin/views/field/Roles.php index 058bb60186d8914f71e29c7380243174317304d4..95afc288641b9bea28b55b493bab87a38de581ef 100644 --- a/lib/Views/user/Plugin/views/field/Roles.php +++ b/lib/Views/user/Plugin/views/field/Roles.php @@ -9,6 +9,7 @@ use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\field\PrerenderList; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Field handler to provide a list of roles. @@ -22,8 +23,12 @@ */ class Roles extends PrerenderList { - public function construct() { - parent::construct(); + /** + * Constructs a Roles object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->additional_fields['uid'] = array('table' => 'users', 'field' => 'uid'); } diff --git a/lib/Views/user/Plugin/views/filter/Current.php b/lib/Views/user/Plugin/views/filter/Current.php index fc9fe68dc9cecf860d3477a0a01ce6be730fecaf..48ffcaf89160b842612dd8605d1e92854b5aa757 100644 --- a/lib/Views/user/Plugin/views/filter/Current.php +++ b/lib/Views/user/Plugin/views/filter/Current.php @@ -9,6 +9,7 @@ use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\filter\BooleanOperator; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Filter handler for the current user. @@ -22,8 +23,12 @@ */ class Current extends BooleanOperator { - public function construct() { - parent::construct(); + /** + * Constructs a Current object. + */ + public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) { + parent::__construct($configuration, $plugin_id, $discovery); + $this->value_value = t('Is the logged in user'); }