Disabling a view mode does not delete field display settings

Created on 28 July 2015, over 9 years ago
Updated 7 November 2024, 16 days ago

Problem/Motivation

At admin/structure/types/manage/article/display I had Default and Teaser view modes, both with different field settings. Then I disabled Teaser view mode under CUSTOM DISPLAY SETTINGS fieldset:

Teaser was disabled, but field display settings for teaser were not be deleted from the database. This can be seen by devel/field/info and in export module by Features:

This causes some modules to load teaser view mode settings despite teaser view mode is disabled.

Proposed resolution

When some view mode custom settings is disable it should delete field display settings for this disabled view mode.

Remaining tasks

Add field display settings delete routine fired by view mode disable.

User interface changes

none

API changes

none

Data model changes

Maybe the routine should be fired by hook_update_N for currently saved settings.

🐛 Bug report
Status

Closed: outdated

Version

11.0 🔥

Component

field system

Created by

🇨🇿Czech Republic Honza Pobořil

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.

  • 🇳🇿New Zealand quietone

    I think @rodrigoaguilera is on the right track in that this is working as designed. The configuration for a view mode can be removed via the UI at admin/structure/display-modes/view.

    If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").

    Thanks!

  • 🇪🇸Spain rodrigoaguilera Barcelona

    I think this is valid for configuration that remains active (but not enabled) and yet invisible in the UI.
    I believe the steps that I provided are still valid to reproduce this.

    I don not agree that once disabled the config for the view mode should remain but if for some reason that is the intended way we can improve the UI following already existing patterns like in views where disabled display modes are still visible and they are clearly marked as disabled.

    Changing the issue title to better reflect this.

Production build 0.71.5 2024