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
Commits
cb230b71
Commit
cb230b71
authored
1 month ago
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3187643
by spokje, acbramley, quietone: Make Node views wizard buildFilters more efficient
parent
87c85acb
No related branches found
No related tags found
3 merge requests
!5423
Draft: Resolve #3329907 "Test2"
,
!3478
Issue #3337882: Deleted menus are not removed from content type config
,
!579
Issue #2230909: Simple decimals fail to pass validation
Pipeline
#482460
passed with warnings
1 month ago
Stage: 🪄 Lint
Stage: 🗜️ Test
Pipeline: drupal
#482465
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/node/src/Plugin/views/wizard/Node.php
+6
-10
6 additions, 10 deletions
core/modules/node/src/Plugin/views/wizard/Node.php
with
6 additions
and
10 deletions
core/modules/node/src/Plugin/views/wizard/Node.php
+
6
−
10
View file @
cb230b71
...
...
@@ -277,17 +277,13 @@ protected function buildFilters(&$form, FormStateInterface $form_state) {
$tag_fields
=
[];
foreach
(
$bundles
as
$bundle
)
{
$display
=
$this
->
entityDisplayRepository
->
getFormDisplay
(
$this
->
entityTypeId
,
$bundle
);
$taxonomy_fields
=
array_filter
(
$this
->
entityFieldManager
->
getFieldDefinitions
(
$this
->
entityTypeId
,
$bundle
),
function
(
FieldDefinitionInterface
$field_definition
)
{
return
$field_definition
->
getType
()
==
'entity_reference'
&&
$field_definition
->
getSetting
(
'target_type'
)
==
'taxonomy_term'
;
});
foreach
(
$taxonomy_fields
as
$field_name
=>
$field
)
{
$widget
=
$display
->
getComponent
(
$field_name
);
// We define "tag-like" taxonomy fields as ones that use the
// "Autocomplete (Tags style)" widget.
if
(
!
empty
(
$widget
)
&&
$widget
[
'type'
]
==
'entity_reference_autocomplete_tags'
)
{
$tag_fields
[
$field_name
]
=
$field
;
$tag_fields
+=
array_filter
(
$this
->
entityFieldManager
->
getFieldDefinitions
(
$this
->
entityTypeId
,
$bundle
),
function
(
FieldDefinitionInterface
$field_definition
)
use
(
$display
)
{
if
(
$field_definition
->
getType
()
==
'entity_reference'
&&
$field_definition
->
getSetting
(
'target_type'
)
==
'taxonomy_term'
)
{
$widget
=
$display
->
getComponent
(
$field_definition
->
getName
());
return
isset
(
$widget
[
'type'
])
&&
$widget
[
'type'
]
==
'entity_reference_autocomplete_tags'
;
}
}
return
FALSE
;
});
}
if
(
!
empty
(
$tag_fields
))
{
// If there is more than one "tag-like" taxonomy field available to
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment