Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!1624
Issue
#2829178
: Views Term ID has broken filters ("All of", "Is none of") and contextual filters "allow multiple"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#2829178
: Views Term ID has broken filters ("All of", "Is none of") and contextual filters "allow multiple"
issue/drupal-2829178:2829178-views-term-id
into
9.4.x
Overview
0
Commits
4
Pipelines
0
Changes
22
Open
Bryan Heisler
requested to merge
issue/drupal-2829178:2829178-views-term-id
into
9.4.x
3 years ago
Overview
0
Commits
4
Pipelines
0
Changes
22
Expand
0
0
Merge request reports
Compare
9.4.x
version 3
4e220e5f
3 years ago
version 2
d5cace9a
3 years ago
version 1
fca17fa8
3 years ago
9.4.x (HEAD)
and
latest version
latest version
5b3266d7
4 commits,
1 year ago
version 3
4e220e5f
4 commits,
3 years ago
version 2
d5cace9a
3 commits,
3 years ago
version 1
fca17fa8
1 commit,
3 years ago
22 files
+
1356
−
42
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
22
Search (e.g. *.vue) (Ctrl+P)
core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php
+
42
−
0
Options
@@ -358,4 +358,46 @@ public function testExposedUnpublishedFilterOptions() {
$this
->
assertEmpty
(
$this
->
cssSelect
(
'option[value="'
.
$this
->
terms
[
1
][
0
]
->
id
()
.
'"]'
));
}
/**
* Tests using the TaxonomyIndexTid in a filter group.
*/
public
function
testFilterGrouping
()
{
$node_type
=
$this
->
drupalCreateContentType
([
'type'
=>
'page'
]);
// Create the tag field itself.
$field_name
=
'taxonomy_tags'
;
$this
->
createEntityReferenceField
(
'node'
,
$node_type
->
id
(),
$field_name
,
NULL
,
'taxonomy_term'
);
// Create 3 nodes: 1 without a term and 2 with different terms.
$this
->
drupalCreateNode
();
$this
->
drupalCreateNode
([
$field_name
=>
[[
'target_id'
=>
$this
->
terms
[
1
][
0
]
->
id
()]],
]);
$this
->
drupalCreateNode
([
$field_name
=>
[[
'target_id'
=>
$this
->
terms
[
2
][
0
]
->
id
()]],
]);
// Create two groups. The first group contains the published filter and set
// up the second group as an 'OR' group for two different terms.
$view
=
View
::
load
(
'test_filter_taxonomy_index_tid'
);
$display
=&
$view
->
getDisplay
(
'default'
);
$display
[
'display_options'
][
'filters'
][
'tid'
][
'value'
][
0
]
=
$this
->
terms
[
1
][
0
]
->
id
();
$display
[
'display_options'
][
'filters'
][
'tid'
][
'group'
]
=
2
;
$display
[
'display_options'
][
'filters'
][
'tid_2'
]
=
$display
[
'display_options'
][
'filters'
][
'tid'
];
$display
[
'display_options'
][
'filters'
][
'tid_2'
][
'id'
]
=
'tid_2'
;
$display
[
'display_options'
][
'filters'
][
'tid_2'
][
'value'
][
0
]
=
$this
->
terms
[
2
][
0
]
->
id
();
$display
[
'display_options'
][
'filter_groups'
]
=
[
'operator'
=>
'AND'
,
'groups'
=>
[
1
=>
'AND'
,
2
=>
'OR'
,
],
];
$view
->
save
();
$this
->
drupalGet
(
'test-filter-taxonomy-index-tid'
);
$xpath
=
$this
->
xpath
(
'//div[@class="view-content"]//a'
);
// We expect both nodes with terms but not the node without a term.
$this
->
assertCount
(
2
,
$xpath
);
}
}
Loading