Active
Project:
Views (for Drupal 7)
Version:
7.x-3.14
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Jul 2016 at 22:50 UTC
Updated:
7 Jul 2016 at 23:14 UTC
Jump to comment: Most recent
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
Comment #2
captainack commentedOkay 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)
2. Forcing consistency of 'title' based on 'title_enable' when saving the options form:
3. The reverse of #2 upon loading the options - overriding 'title_enable' in the event that there's a title:
Do we want to do the same in this case? Is there anything else I missed while searching?
Thanks!
Comment #3
captainack commented#1808824: Default validation criteria for a contextual filter can be wrong is probably also a symptom of this.