From dafcfdeacfad357a85ab52ae25096684ca990ef6 Mon Sep 17 00:00:00 2001
From: slv <slv@826088.no-reply.drupal.org>
Date: Sun, 26 Aug 2012 19:10:39 +0200
Subject: [PATCH] Issue #1757300 by slv_ | dawehner: Remove convert_options()
 on argument validators.

---
 .../argument_default/ArgumentDefaultPluginBase.php    | 11 -----------
 .../views/Plugin/views/argument_default/Fixed.php     |  6 ------
 .../views/Plugin/views/argument_default/Php.php       |  6 ------
 .../ArgumentValidatorPluginBase.php                   | 11 -----------
 .../views/Plugin/views/argument_validator/Php.php     |  6 ------
 .../node/Plugin/views/argument_validator/Node.php     |  9 ---------
 .../taxonomy/Plugin/views/argument_validate/Term.php  |  8 --------
 lib/Views/user/Plugin/views/argument_default/User.php |  6 ------
 .../user/Plugin/views/argument_validator/User.php     |  8 --------
 9 files changed, 71 deletions(-)

diff --git a/lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php b/lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php
index 1e329e7a52e5..65ed2862daba 100644
--- a/lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php
+++ b/lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php
@@ -37,7 +37,6 @@ function init(&$view, &$argument, $options) {
     $this->view = &$view;
     $this->argument = &$argument;
 
-    $this->convert_options($options);
     $this->unpack_options($this->options, $options);
   }
 
@@ -83,16 +82,6 @@ function check_access(&$form, $option_name) {
     }
   }
 
-  /**
-   * Convert options from the older style.
-   *
-   * In Views 3, the method of storing default argument options has changed
-   * and each plugin now gets its own silo. This method can be used to
-   * move arguments from the old style to the new style. See
-   * views_plugin_argument_default_fixed for a good example of this method.
-   */
-  function convert_options(&$options) { }
-
 }
 
 /**
diff --git a/lib/Drupal/views/Plugin/views/argument_default/Fixed.php b/lib/Drupal/views/Plugin/views/argument_default/Fixed.php
index cc688aa6e0c2..a6c6be7846d7 100644
--- a/lib/Drupal/views/Plugin/views/argument_default/Fixed.php
+++ b/lib/Drupal/views/Plugin/views/argument_default/Fixed.php
@@ -45,10 +45,4 @@ function get_argument() {
     return $this->options['argument'];
   }
 
-  function convert_options(&$options) {
-    if (!isset($options['argument']) && isset($this->argument->options['default_argument_fixed'])) {
-      $options['argument'] = $this->argument->options['default_argument_fixed'];
-    }
-  }
-
 }
diff --git a/lib/Drupal/views/Plugin/views/argument_default/Php.php b/lib/Drupal/views/Plugin/views/argument_default/Php.php
index ec97dfb52ebc..0a013b2de67b 100644
--- a/lib/Drupal/views/Plugin/views/argument_default/Php.php
+++ b/lib/Drupal/views/Plugin/views/argument_default/Php.php
@@ -42,12 +42,6 @@ function options_form(&$form, &$form_state) {
     $this->check_access($form, 'code');
   }
 
-  function convert_options(&$options) {
-    if (!isset($options['code']) && isset($this->argument->options['default_argument_php'])) {
-      $options['code'] = $this->argument->options['default_argument_php'];
-    }
-  }
-
   /**
    * Only let users with PHP block visibility permissions set/modify this
    * default plugin.
diff --git a/lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php b/lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php
index 99a299203607..bdf3ff307e1d 100644
--- a/lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php
+++ b/lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php
@@ -30,7 +30,6 @@ function init(&$view, &$argument, $options) {
     $this->view = &$view;
     $this->argument = &$argument;
 
-    $this->convert_options($options);
     $this->unpack_options($this->options, $options);
   }
 
@@ -55,16 +54,6 @@ function options_validate(&$form, &$form_state) { }
    */
   function options_submit(&$form, &$form_state, &$options = array()) { }
 
-  /**
-   * Convert options from the older style.
-   *
-   * In Views 3, the method of storing default argument options has changed
-   * and each plugin now gets its own silo. This method can be used to
-   * move arguments from the old style to the new style. See
-   * views_plugin_argument_default_fixed for a good example of this method.
-   */
-  function convert_options(&$options) { }
-
   /**
    * Determine if the administrator has the privileges to use this plugin
    */
diff --git a/lib/Drupal/views/Plugin/views/argument_validator/Php.php b/lib/Drupal/views/Plugin/views/argument_validator/Php.php
index 94e0979ecbce..b6699c39fdf5 100644
--- a/lib/Drupal/views/Plugin/views/argument_validator/Php.php
+++ b/lib/Drupal/views/Plugin/views/argument_validator/Php.php
@@ -49,12 +49,6 @@ function access() {
     return user_access('use PHP for settings');
   }
 
-  function convert_options(&$options) {
-    if (!isset($options['code']) && isset($this->argument->options['validate_argument_php'])) {
-      $options['code'] = $this->argument->options['validate_argument_php'];
-    }
-  }
-
   function validate_argument($argument) {
     // set up variables to make it easier to reference during the argument.
     $view = &$this->view;
diff --git a/lib/Views/node/Plugin/views/argument_validator/Node.php b/lib/Views/node/Plugin/views/argument_validator/Node.php
index da0672159dbd..e20d2b071479 100644
--- a/lib/Views/node/Plugin/views/argument_validator/Node.php
+++ b/lib/Views/node/Plugin/views/argument_validator/Node.php
@@ -80,15 +80,6 @@ function options_submit(&$form, &$form_state, &$options = array()) {
     $options['types'] = array_filter($options['types']);
   }
 
-  function convert_options(&$options) {
-    if (!isset($options['types']) && !empty($this->argument->options['validate_argument_node_type'])) {
-      $options['types'] = isset($this->argument->options['validate_argument_node_type']) ? $this->argument->options['validate_argument_node_type'] : array();
-      $options['access'] = !empty($this->argument->options['validate_argument_node_access']);
-      $options['access_op'] = isset($this->argument->options['validate_argument_node_access_op']) ? $this->argument->options['validate_argument_node_access_op'] : 'view';
-      $options['nid_type'] = isset($this->argument->options['validate_argument_nid_type']) ? $this->argument->options['validate_argument_nid_type'] : array();
-    }
-  }
-
   function validate_argument($argument) {
     $types = $this->options['types'];
 
diff --git a/lib/Views/taxonomy/Plugin/views/argument_validate/Term.php b/lib/Views/taxonomy/Plugin/views/argument_validate/Term.php
index d2a27a2b1be0..d57877a6807e 100644
--- a/lib/Views/taxonomy/Plugin/views/argument_validate/Term.php
+++ b/lib/Views/taxonomy/Plugin/views/argument_validate/Term.php
@@ -87,14 +87,6 @@ function options_submit(&$form, &$form_state, &$options = array()) {
     $options['vocabularies'] = array_filter($options['vocabularies']);
   }
 
-  function convert_options(&$options) {
-    if (!isset($options['vocabularies']) && !empty($this->argument->options['validate_argument_vocabulary'])) {
-      $options['vocabularies'] = $this->argument->options['validate_argument_vocabulary'];
-      $options['type'] = $this->argument->options['validate_argument_type'];
-      $options['transform'] = isset($this->argument->options['validate_argument_transform']) ? $this->argument->options['validate_argument_transform'] : FALSE;
-    }
-  }
-
   function validate_argument($argument) {
     $vocabularies = array_filter($this->options['vocabularies']);
     $type = $this->options['type'];
diff --git a/lib/Views/user/Plugin/views/argument_default/User.php b/lib/Views/user/Plugin/views/argument_default/User.php
index a5bdc017f355..5f31360c8d55 100644
--- a/lib/Views/user/Plugin/views/argument_default/User.php
+++ b/lib/Views/user/Plugin/views/argument_default/User.php
@@ -37,12 +37,6 @@ function options_form(&$form, &$form_state) {
     );
   }
 
-  function convert_options(&$options) {
-    if (!isset($options['user']) && isset($this->argument->options['default_argument_user'])) {
-      $options['user'] = $this->argument->options['default_argument_user'];
-    }
-  }
-
   function get_argument() {
     foreach (range(1, 3) as $i) {
       $user = menu_get_object('user', $i);
diff --git a/lib/Views/user/Plugin/views/argument_validator/User.php b/lib/Views/user/Plugin/views/argument_validator/User.php
index 5c1cb457b8dc..7704896cb41e 100644
--- a/lib/Views/user/Plugin/views/argument_validator/User.php
+++ b/lib/Views/user/Plugin/views/argument_validator/User.php
@@ -72,14 +72,6 @@ function options_submit(&$form, &$form_state, &$options = array()) {
     $options['roles'] = array_filter($options['roles']);
   }
 
-  function convert_options(&$options) {
-    if (!isset($options['type']) && isset($this->argument->options['validate_user_argument_type'])) {
-      $options['type'] = $this->argument->options['validate_user_argument_type'];
-      $options['restrict_roles'] = $this->argument->options['validate_user_restrict_roles'];
-      $options['roles'] = $this->argument->options['validate_user_roles'];
-    }
-  }
-
   function validate_argument($argument) {
     $type = $this->options['type'];
     // is_numeric() can return false positives, so we ensure it's an integer.
-- 
GitLab