Hi.

This was tricky to track down, because it caused certain arguments to work and others to not work.

Anyway, views_handler_argument::validate_arg() in handlers/views_handler_argument.inc ignores the 'specify_validation' setting and tries running the validation regardless (in my case, often failing :-/).

Line 984 reads:

    if ($this->options['validate']['type'] == 'none') {
      return $this->argument_validated = $this->validate_argument_basic($arg);
    }

Instead, I think it should read...

    if (empty($this->options['specify_validation']) || ($this->options['validate']['type'] == 'none')) {
      return $this->argument_validated = $this->validate_argument_basic($arg);
    }

Patch coming...

Comments

captainack created an issue. See original summary.

captainack’s picture

Issue summary: View changes

Okay before submitting the patch I wanted to make sure my proposal was consistent with how this was handled in other cases where an option's value is only relevant depending on another option... So I checked title_enable vs title.

It looks like in that case, 3 things are happening:
1. Something analogous to what I proposed (acting on title only if title_enable is true)

        // Test to see if we should use this argument's title
        if (!empty($argument->options['title_enable']) && !empty($argument->options['title'])) {
          $title = $argument->options['title'];
        }

2. Forcing consistency of 'title' based on 'title_enable' when saving the options form:

    // Clear out the content of title if it's not enabled.
    $options =& $form_state['values']['options'];
    if (empty($options['title_enable'])) {
      $options['title'] = '';
    }

3. The reverse of #2 upon loading the options - overriding 'title_enable' in the event that there's a title:

    if (!empty($options['title']) && !isset($options['title_enable'])) {
      $this->options['title_enable'] = 1;
    }

Do we want to do the same in this case? Is there anything else I missed while searching?

Thanks!