- First commit to issue fork.
We wanted an easy way to see which content had already used a unique title, so we added a link on the node title in the error message.
Configure this module to have unique content titles. Submit a new piece of content with a conflicting title.
diff --git a/src/Plugin/Validation/Constraint/NodeTitleConstraintValidator.php b/src/Plugin/Validation/Constraint/NodeTitleConstraintValidator.php
index 3fb9e391f..322f8553d 100644
--- a/src/Plugin/Validation/Constraint/NodeTitleConstraintValidator.php
+++ b/src/Plugin/Validation/Constraint/NodeTitleConstraintValidator.php
@@ -184,7 +184,7 @@ public function validate($items, Constraint $constraint) {
}
// Show error.
if (!empty($nodes)) {
- $message = $this->t("The title must be unique. Other content is already using this title: @title", ['@title' => $value_title]);
+ $message = $this->t("The title must be unique. Other content is already using this title: <a href='@nodeurl'>@title</a>", ['@nodeurl'=> reset($nodes)->toUrl()->toString(), '@title' => $value_title]);
$this->context->addViolation($message);
}
}
testing?
Adds a link to the content that already has a unique title
None.
None.
Active
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.