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
8c4591e2
Verified
Commit
8c4591e2
authored
3 weeks ago
by
Dave Long
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3519271
by catch: ViewsViewsHooks queries all field storages twice
parent
8c477343
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
#491123
passed
3 weeks ago
Stage: 🪄 Lint
Stage: 🗜️ Test
Pipeline: drupal
#491124
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/views/src/Hook/ViewsViewsHooks.php
+1
-22
1 addition, 22 deletions
core/modules/views/src/Hook/ViewsViewsHooks.php
with
1 addition
and
22 deletions
core/modules/views/src/Hook/ViewsViewsHooks.php
+
1
−
22
View file @
8c4591e2
...
...
@@ -183,34 +183,13 @@ public function viewsData(): array {
if
(
is_array
(
$result
))
{
$data
=
NestedArray
::
mergeDeep
(
$result
,
$data
);
}
\Drupal
::
moduleHandler
()
->
invoke
(
$field_storage
->
getTypeProvider
(),
'field_views_data_views_data_alter'
,
[
&
$data
,
$field_storage
]);
}
}
}
return
$data
;
}
/**
* Implements hook_views_data_alter().
*
* Field modules can implement hook_field_views_data_views_data_alter() to
* alter the views data on a per field basis. This is weirdly named so as not
* to conflict with the \Drupal::moduleHandler()->alter('field_views_data') in
* views_views_data().
*/
#[Hook('views_data_alter')]
public
function
viewsDataAlter
(
&
$data
)
:
void
{
$entity_type_manager
=
\Drupal
::
entityTypeManager
();
if
(
!
$entity_type_manager
->
hasDefinition
(
'field_storage_config'
))
{
return
;
}
/** @var \Drupal\field\FieldStorageConfigInterface $field_storage */
foreach
(
$entity_type_manager
->
getStorage
(
'field_storage_config'
)
->
loadMultiple
()
as
$field_storage
)
{
if
(
\Drupal
::
service
(
'views.field_data_provider'
)
->
getSqlStorageForField
(
$field_storage
))
{
\Drupal
::
moduleHandler
()
->
invoke
(
$field_storage
->
getTypeProvider
(),
'field_views_data_views_data_alter'
,
[
&
$data
,
$field_storage
]);
}
}
}
/**
* Implements hook_field_views_data().
*
...
...
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