backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

[UX] Improve the way we handle things and warn users when a menu is deleted. #678

Open klonos opened 9 years ago

klonos commented 9 years ago

I went with a generic title for this issue, but it happened with a menu for me. So, test case:

  1. create a "test menu" menu with some links
  2. edit the default layout and add the block provided for that menu in a region (for example in the footer)
  3. delete the menu
  4. edit the layout and notice an empty placeholder (with a "configure/remove") dropbutton: empty_block_after_menu_deleted
  5. the "configure" link does nothing
  6. the "remove" link works, but throws this error:
Notice: Undefined index: menu-test-menu in BlockLegacy->getAdminTitle() (line 66 of C:\www\backdrop\core\modules\layout\includes\block_legacy.class.inc).
quicksketch commented 9 years ago

Thanks @klonos, that's a great report. At the very least, we could render this as a "broken" block, which would prevent it from being edited.

We need a generic way to tell layouts "delete all instances of this block", as we face this same problem when uninstalling a module in https://github.com/backdrop/backdrop-issues/issues/570.

klonos commented 9 years ago

...a bit of an update here:

broken_block_when_menu_removed

This is much better, but as you said Nate, we need to automatically remove the block for better [UX].

klonos commented 9 years ago

...if we end up keeping the current behavior (the explanation text), we should at least remove the "configure" option because the only thing it does for broken blocks is creating error entries in the dblog (#690).

Also, a minor UX improvement in any case -other than automatically deleting these broken blocks- would be to give people a hint in the block title by sticking the name of the module that provided the block between the "Broken" and "block". So, in this case with menus it would be "Broken menu block".

klonos commented 8 years ago

Tasks remaining to be done here (if everybody agrees):

  1. Remove the "Configure" action from broken blocks.
  2. Add the module name to the broken block admin title ("Broken menu block" or "Broken views block" instead of just "Broken block").

This is different from #570 because in this case the module that provides the block was not disabled/uninstalled - the menu was simply deleted.

There is little that a user can do in these cases: they can only remove the block. Is there perhaps a way and more importantly would it make sense to provide some sort of "assign new menu" link here in order to bring these sort of broken blocks back to life?

IMO, it would be wrong to remove these blocks automatically. They should be left in place with the warning until the user decides to manually remove them.

klonos commented 8 years ago

Similarly to #1624 (but that one is different in that it deals with entire modules being removed), here we can warn the user that the menu they are about to delete is used in a layout (or many layouts - just list them all in the confirmation page).

ghost commented 3 years ago

I believe this issue can be closed... As per @klonos' remaining tasks:

klonos commented 3 years ago

Actually @BWPanda there are a few things we can do here to improve UX: