farm_update does not revert views with reordered fields

Created on 7 December 2022, over 2 years ago
Updated 30 October 2023, over 1 year ago

Problem/Motivation

I've ran into an issue where the farm_update module does not revert a view when the only thing that has changed is the order of the view's fields.

This is caused by the config_update.config_diff service which normalizes config and sorts by array keys alphabetically when comparing two config items. Because the views field order is determined by the order of the field keys (there is no weight), if the only thing that changes is the field order, then the view config is not considered updated, and farm_update does not revert the config.

Normalize source: https://git.drupalcode.org/project/config_update/-/blob/8.x-1.x/src/Conf...

This behavior can also be observed in the Config Update UI, for views at /admin/config/development/configuration/report/type/view

However, as noted in ConfigDiffer::same:

It is up to the particular implementing
* class to decide what normalizing means.

Steps to reproduce

  1. Enable views_ui and modify the order of fields in the farm_log view.
  2. Confirm that the field order changed at /logs.
  3. Clear caches.
  4. Observe that the views field order remains the same and was not reverted.

Proposed resolution

Not sure if there is an easy solution to this. Maybe we could normalize view config in a different way ourselves? But are there other types of config that would common suffer from the same issue?

Remaining tasks

Identify solution and/or document this limitation

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States paul121 Spokane, WA

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024