Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294649

Warn user when entity delete will cause menu item re-parenting

$
0
0

Problem/Motivation

Deleting an entity in the middle/top of the menu tree causes unexpected results for content editors.

Steps to reproduce

  1. Install Drupal Core
  2. Create some entities
  3. Build out a simple main menu tree. For example:
    Menu item 1
    Menu item 2
       |- Menu item 2.a
       |- Menu item 2.b
       |- Menu item 2.c
    

3. Delete the "Menu item 2" node

Woah, all of a sudden the main navigation (site-wide) has three new top-level menu items. This is even more of a surprise if the "Menu item 2" menu item was disabled, or the related entity was unpublished (because you would've forgotten that it has children).

Proposed resolution

Warn before the delete (but we can't do that everywhere), and notify after the delete.

Pre-delete warning

Delete forms currently:

Are you sure you want to delete the content item ?
This action cannot be undone.

Update delete forms with informational text:

This content has 3 menu children. Proceeding will move these one level higher in the menu hierarchy:
* Foo (link to /admin/structure/menu/item/[id]/edit)
* Bar (link to /admin/structure/menu/item/[id]/edit)
* Baz (link to /admin/structure/menu/item/[id]/edit)

Post-delete notification

Show a warning message afterwards (same as above, just changing the verb tense):

Content was deleted that had menu children. These have been moved one level higher in the menu hierarchy:

* Foo (link to /admin/structure/menu/item/[id]/edit)
* Bar (link to /admin/structure/menu/item/[id]/edit)
* Baz (link to /admin/structure/menu/item/[id]/edit)

All entity types

We should should generalize to all entity types. e.g. " was deleted that had menu children..."

Remaining tasks

  • Discussion Complete
  • Finish implementation of pre-delete warning Complete
  • Start implementation of post-delete notification Complete

User interface changes

  • Messages on delete form.
  • Message via messenger after entity is deleted via entity delete form.

API changes

None

Data model changes

None

Release notes snippet

TBD


Viewing all articles
Browse latest Browse all 294649

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>