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

Drupal should warn if your node delete will cause menu item re-parenting

$
0
0

Problem/Motivation

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

Steps to reproduce

1. Install Drupal Core
2. Create some nodes and build out a simple main menu tree like

Children's Health, Safety and Wellbeing
Mental Health
   |- ADHD
   |- Anxiety and depression
   |- Autism

3. Delete the "Mental Health" node
Woah, all of a sudden the main navigation (site-wide) has all these new top-level menu items. This is even more of a surprise if the "Mental Health" menu item was disabled, or its node 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.

Warn before

/node/*/delete currently says

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

We should also say something like

This page has 3 menu children. These will be moved one page 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)

Notify after

Not all node deletions go through /node/*/delete. So we should also show a warning message afterwards (same as above, just changing the verb tense):

A page was deleted that had 3 menu children. These have been moved one page 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)

Remaining tasks

* Discussion
* Implementation

User interface changes

* New messaging

API changes

None

Data model changes

None

Release notes snippet

TBD


Viewing all articles
Browse latest Browse all 293619

Trending Articles



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