Document ViewsConfigUpdater

Created on 17 May 2024, 7 months ago
Updated 17 July 2024, 5 months ago

Problem/Motivation

Anytime configuration for views is changed things need to pass through the ViewsConfigUpdater. web/core/modules/views/src/ViewsConfigUpdater.php

This class is really complex even though it's essential for managing config changes.

I would like to help document the class, possibly simplify the class and a stretch goal may be determine if this can be extended to help with updating more generic config updates.

Steps to reproduce

Review some issues that have updated views:
https://www.drupal.org/project/drupal/issues/2640994#comment-15597379 πŸ› Fix label token replacement for views entity reference arguments Fixed
https://www.drupal.org/project/drupal/issues/3333401 πŸ› Pager h4 causes accessibility flag on many pages Fixed

Proposed resolution

ViewsConfigUpdater is a class that helps when views config changes happen.
It is needed whenever a views configuration item is added, removed or modified.

The method you create to process the update needs to be called in two places:
updateAll
and
views.post_update

The primary function is processDisplayHandlers which is very complex, but essentially loops over the nested display config.

After updating you will need to update several things in core.
1. Any embedded views will need to be updated with the new config.
2. You will need a new view test to confirm your updates add / remove / update the config as expected.
It is important to note that some of these views that need to be updated may be in zips in the codebase.

In some cases you may need to deprecate the configuration.

Remaining tasks

TBD

User interface changes

N/A

API changes

TBD

Data model changes

N/A

Release notes snippet

TBD

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
DocumentationΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024