Skip to content
Snippets Groups Projects
Commit dafcfdea authored by Salvador Molina's avatar Salvador Molina Committed by Tim Plunkett
Browse files

Issue #1757300 by slv_ | dawehner: Remove convert_options() on argument validators.

parent e9d7edb7
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -37,7 +37,6 @@ function init(&$view, &$argument, $options) { ...@@ -37,7 +37,6 @@ function init(&$view, &$argument, $options) {
$this->view = &$view; $this->view = &$view;
$this->argument = &$argument; $this->argument = &$argument;
$this->convert_options($options);
$this->unpack_options($this->options, $options); $this->unpack_options($this->options, $options);
} }
...@@ -83,16 +82,6 @@ function check_access(&$form, $option_name) { ...@@ -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) { }
} }
/** /**
......
...@@ -45,10 +45,4 @@ function get_argument() { ...@@ -45,10 +45,4 @@ function get_argument() {
return $this->options['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'];
}
}
} }
...@@ -42,12 +42,6 @@ function options_form(&$form, &$form_state) { ...@@ -42,12 +42,6 @@ function options_form(&$form, &$form_state) {
$this->check_access($form, 'code'); $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 * Only let users with PHP block visibility permissions set/modify this
* default plugin. * default plugin.
......
...@@ -30,7 +30,6 @@ function init(&$view, &$argument, $options) { ...@@ -30,7 +30,6 @@ function init(&$view, &$argument, $options) {
$this->view = &$view; $this->view = &$view;
$this->argument = &$argument; $this->argument = &$argument;
$this->convert_options($options);
$this->unpack_options($this->options, $options); $this->unpack_options($this->options, $options);
} }
...@@ -55,16 +54,6 @@ function options_validate(&$form, &$form_state) { } ...@@ -55,16 +54,6 @@ function options_validate(&$form, &$form_state) { }
*/ */
function options_submit(&$form, &$form_state, &$options = array()) { } 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 * Determine if the administrator has the privileges to use this plugin
*/ */
......
...@@ -49,12 +49,6 @@ function access() { ...@@ -49,12 +49,6 @@ function access() {
return user_access('use PHP for settings'); 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) { function validate_argument($argument) {
// set up variables to make it easier to reference during the argument. // set up variables to make it easier to reference during the argument.
$view = &$this->view; $view = &$this->view;
......
...@@ -80,15 +80,6 @@ function options_submit(&$form, &$form_state, &$options = array()) { ...@@ -80,15 +80,6 @@ function options_submit(&$form, &$form_state, &$options = array()) {
$options['types'] = array_filter($options['types']); $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) { function validate_argument($argument) {
$types = $this->options['types']; $types = $this->options['types'];
......
...@@ -87,14 +87,6 @@ function options_submit(&$form, &$form_state, &$options = array()) { ...@@ -87,14 +87,6 @@ function options_submit(&$form, &$form_state, &$options = array()) {
$options['vocabularies'] = array_filter($options['vocabularies']); $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) { function validate_argument($argument) {
$vocabularies = array_filter($this->options['vocabularies']); $vocabularies = array_filter($this->options['vocabularies']);
$type = $this->options['type']; $type = $this->options['type'];
......
...@@ -37,12 +37,6 @@ function options_form(&$form, &$form_state) { ...@@ -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() { function get_argument() {
foreach (range(1, 3) as $i) { foreach (range(1, 3) as $i) {
$user = menu_get_object('user', $i); $user = menu_get_object('user', $i);
......
...@@ -72,14 +72,6 @@ function options_submit(&$form, &$form_state, &$options = array()) { ...@@ -72,14 +72,6 @@ function options_submit(&$form, &$form_state, &$options = array()) {
$options['roles'] = array_filter($options['roles']); $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) { function validate_argument($argument) {
$type = $this->options['type']; $type = $this->options['type'];
// is_numeric() can return false positives, so we ensure it's an integer. // is_numeric() can return false positives, so we ensure it's an integer.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment