Commit 1ed61472 authored by xjm's avatar xjm

Issue #2605738 by chx, tim.plunkett: This is either an apple or an elephant

parent 034a8509
......@@ -351,8 +351,11 @@ public function loadLinksByRoute($route_name, array $route_parameters = array(),
* {@inheritdoc}
*/
public function addDefinition($id, array $definition) {
if ($this->treeStorage->load($id) || $id === '') {
throw new PluginException("The ID $id already exists as a plugin definition or is not valid");
if ($this->treeStorage->load($id)) {
throw new PluginException("The menu link ID $id already exists as a plugin definition");
}
elseif ($id === '') {
throw new PluginException("The menu link ID cannot be empty");
}
// Add defaults, so there is no requirement to specify everything.
$this->processDefinition($definition, $id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment