Skip to content
Snippets Groups Projects
Commit 89429310 authored by Neil Drumm's avatar Neil Drumm :wave:
Browse files

Issue #3246680: Also match on whether or not versions have an API prefix

parent 98e15a58
No related branches found
No related tags found
No related merge requests found
...@@ -127,9 +127,12 @@ class project_release_handler_filter_version extends views_handler_filter_field_ ...@@ -127,9 +127,12 @@ class project_release_handler_filter_version extends views_handler_filter_field_
foreach ($this->value as &$value) { foreach ($this->value as &$value) {
if (preg_match('/^(?<type>any|all)_(?<series>.*)$/', $value, $match)) { if (preg_match('/^(?<type>any|all)_(?<series>.*)$/', $value, $match)) {
if ($match['type'] === 'any') { if ($match['type'] === 'any') {
// Use option groups which match the version number prefix. // Use option groups which match the version number prefix and
// existence of an API prefix.
$has_api_tid_regex = project_release_has_api_tid_regex();
$has_api_tid = preg_match($has_api_tid_regex, $match['series']);
foreach (array_filter($this->value_options, 'is_array') as $key => $options) { foreach (array_filter($this->value_options, 'is_array') as $key => $options) {
if (strpos($key, $match['series']) === 0) { if (strpos($key, $match['series']) === 0 && preg_match($has_api_tid_regex, $key) === $has_api_tid) {
$this->value += $options; $this->value += $options;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment