Problem/Motivation

"The ID $id already exists as a plugin definition or is not valid" -- that's one mighty odd error message! I mean... which of the two? Both can not be! Especially because the condition is split already between the two.

Proposed resolution

Write two error messages.... it's not even in t() so breaks nothing.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#5 apple_or_elephant.patch958 byteschx
apple_or_elephant.patch960 byteschx

Comments

chx created an issue. See original summary.

benjy’s picture

Status: Needs review » Reviewed & tested by the community

Patch seems good.

dawehner’s picture

+1

tim.plunkett’s picture

We're not supposed to end exception messages with periods. Could be fixed on commit.

chx’s picture

StatusFileSize
new958 bytes

Periods removed.

wim leers’s picture

BEST ISSUE TITLE EVER!

jibran’s picture

Issue tags: +rc target triage

Tagging.

xjm’s picture

Issue tags: -rc target triage +rc target

@effulgentsia and I agree!

xjm’s picture

Status: Reviewed & tested by the community » Fixed

Made another grammar fix on commit:

diff --git a/core/lib/Drupal/Core/Menu/MenuLinkManager.php b/core/lib/Drupal/Core/Menu/MenuLinkManager.php
index 9413368..beb0d95 100644
--- a/core/lib/Drupal/Core/Menu/MenuLinkManager.php
+++ b/core/lib/Drupal/Core/Menu/MenuLinkManager.php
@@ -355,7 +355,7 @@ public function addDefinition($id, array $definition) {
       throw new PluginException("The menu link ID $id already exists as a plugin definition");
     }
     elseif ($id === '') {
-      throw new PluginException("The menu link ID can not be empty");
+      throw new PluginException("The menu link ID cannot be empty");
     }
     // Add defaults, so there is no requirement to specify everything.
     $this->processDefinition($definition, $id);

Committed and pushed to 8.0.x. Thanks!

  • xjm committed 1ed6147 on 8.0.x
    Issue #2605738 by chx, tim.plunkett: This is either an apple or an...

  • xjm committed 1ed6147 on 8.1.x
    Issue #2605738 by chx, tim.plunkett: This is either an apple or an...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.