Views UI sometimes fails to set overridden display to "All displays"

Created on 11 September 2017, almost 7 years ago
Updated 31 May 2022, over 2 years ago

Problem/Motivation

When trying to set part of an overridden display's configuration, the user ends up with broken configuration.

Steps to reproduce:

  1. Create a view with a display (A) with overridden filters
  2. Save
  3. Edit the view to make A's filters the default filters, e.g. via "Rearrange filters" dialog (ie on the Rearrange Filters dialog, select 'All Displays' in the For option.)
  4. Notice that A's filters have changed, instead of the default display's

Expected result:
Display A's filters are set as default. Display A no longer uses overridden filters.

Actual result:
Display A uses the filters of the default display. Display A no longer uses overridden filters.

This means, that upon saving the view, A's filters are lost irreversibly.
If both the default and the overridden display used filters of the same names, this will be hard to spot and lead to confusion and possibly errors later on, as filter values are changed behind the scenes. If A used additional filters, these will all be changed to "Broken handler".

The "Use as default" behavior effectively duplicates the "Revert to default" behavior, with the added bonus of unexpectedly altering the view. This broken behavior has been around for quite a while, and also happened in D7 (see https://www.drupal.org/node/2313791 β†’ ).

Proposed resolution

Upon closer inspection, it seems that views_ui never actually passes the display's configuration to the default display, even though the code comments state it does. So we have to properly implement this de-override behavior.

Remaining tasks

Write tests to reproduce, review suggested patch.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Views UIΒ  β†’

Last updated 9 days ago

Created by

πŸ‡©πŸ‡ͺGermany ckaotik Berlin

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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