ViewsConfigUpdater $deprecationsEnabled flag does not persist to preSave hook

Created on 9 June 2025, 3 months ago

Problem/Motivation

In πŸ› Remove duplicate "add block" link from block content type view's "Results not found" message Postponed we are adding a new post update hook that updates views configs. This has started triggering deprecation errors from other views post update hooks (at this time views_post_update_table_css_class) because ViewsConfigUpdater is created using the classResolver pattern in both the post_update and ViewsHooks::viewPresave which means $view_config_updater->setDeprecationsEnabled(FALSE); does not persist from the post update to the presave.

This is compounded by the fact that for every views post update hook, the presave is called and then all views updates are run again on every view since the presave runs updateAll. This should be fixed in a separate issue.

Steps to reproduce

See https://git.drupalcode.org/issue/drupal-3095893/-/jobs/5480383

Proposed resolution

Turn ViewsConfigUpdater into a service so the class property persists.

Remaining tasks

Review
Commit

API changes

ViewsConfigUpdater is now a service

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

views.module

Created by

πŸ‡¦πŸ‡ΊAustralia acbramley

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024