When deleting a content type field, users do not realize the related View also is deleted

Created on 9 April 2015, over 9 years ago
Updated 14 October 2023, about 1 year ago

Problem/Motivation

When deleting a content type field, the UI shows the view as a dependency under configuration deletions and deletes the view when you confirm the delete.
In D7, the view gets automatically updated. (sort of, see #15). Users apparently do not expect this behavior and end up accidentally deleting a whole view. Possible user experience problems with this:

  1. The delete section is at the bottom of what is potentially a long list of updated configuration.
  2. Users get used to just confirming the less severe configuration entity updates and so are not aware they are deleting a whole view.
  3. Even if the user sees the message about deletion, there is no information on how to fix it instead.

Proposed resolution

The behavior itself should not be changed, but we can improve the user experience problem:

  • Make deletions more obvious than automated dependency removals, possibly with a confirm form.
  • Provide stronger/clearer warnings in the UI, e.g."Warning: You are about to delete an entire view".
  • Provide instructions on what to do instead,e.g. "To remove this field without deleting these items, first edit the items so they no longer use this field."

Alternate resolution from #51 and onward:

The behaviour should be changed. By default, the View should just be disabled. An attempt can be made to update it by removing handlers that trigger the dependency, if this still leaves dependencies, disable the View so the user can manually update the View before enabling it again. This will prevent any unexpected data loss.
Things to look at (possibly in follow-ups):

Alternate resolution from #91 and onward:

The behaviour should be changed but only for field handlers. The proposed solution would be to remove any field handlers that have a dependency on any configuration being removed. If that solves all the dependencies then the View can just be updated and saved without this field. Dependencies because of other handlers (filters, relationships et al.) will still cause the whole View to be deleted. The removal of a field handler should have little impact on the overall working of the View, so the normal notice that it will be updated should suffice for that.
The deletion of a View because of a field handler is probably the most commonly occurring situation and the one where removing the handler should not have any dramatic effects.
Follow ups will be opened to see how we can handle the other types of handlers on a handler-type basis.

Remaining tasks

Decide on a proposed resolution. Needs designs and usability review for them once proposed.

User interface changes

TBD

Original report by [username]

I created a 'date' field on a content type and a view to for this content type.
Then i deleted the 'date' field from the content type and the whole view got deleted also without any warnings.

πŸ› Bug report
Status

Fixed

Version

8.4 ⚰️

Component
ViewsΒ  β†’

Last updated about 4 hours ago

Created by

πŸ‡¬πŸ‡·Greece _dcre_

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Triaged core major

    There is consensus among core maintainers that this is a major issue. Only core committers should add this tag.

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.

  • πŸ‡¦πŸ‡ΊAustralia Ryanm81

    This is still happening in Drupal 10.1, at least for taxonomy term fields/views.

    I must be missing something, but surely by design when you remove a field from a taxonomy/content type it should not then remove views associated with not just that field, but the entire term/content type? If so, is there some sort of recommended way to remove unused fields to preserve keeping any associated views in place?

  • In Drupal 9.5.11, after deleting a float field of a custom content type, the corresponding view having table format can still be edited, saved, enabled, disabled and previewed, but its path returns a "page not found" error.

  • πŸ‡¦πŸ‡ΉAustria maxilein

    And please log all the concerned views in recent log messages.

Production build 0.71.5 2024