Needs work
Project:
Drupal core
Version:
main
Component:
menu system
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 Jul 2014 at 13:00 UTC
Updated:
11 Nov 2020 at 19:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
yesct commentedThese look like the ones that Part 1 issue were adding:
core/lib/Drupal/Core/Menu/MenuLinkBase.php
194: throw new PluginException(String::format('Menu link plugin with ID @id does not support deletion', array('@id' => $this->getPluginId())));
core/lib/Drupal/Core/Menu/MenuLinkManager.php
280: throw new PluginException(String::format('Menu link plugin with ID @id does not support deletion', array('@id' => $id)));
348: throw new PluginException(String::format('The ID @id already exists as a plugin definition or is not valid', array('@id' => $id)));
395: throw new PluginException(String::format('Menu link %id is not resetable', array('%id' => $id)));
core/lib/Drupal/Core/Menu/MenuTreeStorage.php
398: throw new PluginException(String::format('The link with ID @id or its children exceeded the maximum depth of @depth', array('@id' => $link['id'], '@depth' => $this->maxDepth())));
1152: throw new PluginException($e->getMessage(), NULL, $e);
Comment #2
xjmComment #3
yesct commentedComment #4
cilefen commentedComment #5
cilefen commentedComment #6
dawehnerThis does not have to be postponed any longer.
Comment #7
cilefen commentedTrying a PluginNotDeletableException. Is this the sort of thing we want?
Comment #8
dawehnerThank you for working on this issue.
I don't really like "hardcoding" the exception message.
There is no such concept as deletion of plugins outside of menus
Comment #9
cilefen commented@dawehner: Thank you for reviewing. So, it should be MenuLinkPluginNotDeletableException or something like that? Or, should we go for a MenuLinkPluginException to be more generic.
Comment #10
cilefen commentedreroll
Comment #11
cilefen commentedI think MenuLinkManager->addDefinition() could use InvalidPluginDefinitionException.
Comment #12
cilefen commentedShould these exceptions live in Drupal\Core\Menu?
Comment #19
borisson_I think this is a good idea.
String::format should be removed and this can just use string interpolation here.
Comment #23
anmolgoyal74 commentedRe-rolled for 9.2.x and addressed #19.
Comment #24
borisson_The interdiff looks confusing but the patch looks great. Setting to rtbc.
Comment #25
catchThis needs a change record and release notes mention.
Also beyond that, I wonder whether we can actually do this in a minor release - we might need to document that it will throw the more narrow exception in 9.x and make the change itself in 10.x