Skip to content
Snippets Groups Projects
Commit 2763876c authored by catch's avatar catch
Browse files

Issue #3193771 by larowlan, sk_10, quietone:...

Issue #3193771 by larowlan, sk_10, quietone: Drupal\Component\Plugin\Exception\PluginNotFoundException: The "'"--><" entity type does not exist

(cherry picked from commit 26130ff2)
parent 8f1f2a41
Branches
Tags
5 merge requests!1285Issue #3240655 by elfakhar Aligne the active border,!541Issue #3123070: Fix 'PSR2.Classes.PropertyDeclaration.Underscore' coding standard,!463Resolve #3205025 "Class align center for media",!386Allow multiple vocabularies in the taxonomy filter,!308Issue #3118206: Remote media does not validate provider
......@@ -63,7 +63,9 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Con
*/
public function convert($value, $definition, $name, array $defaults) {
$entity_type_id = $this->getEntityTypeFromDefaults($definition, $name, $defaults);
if (!$this->entityTypeManager->hasDefinition($entity_type_id)) {
return NULL;
}
// If the entity type is dynamic, confirm it to be a config entity. Static
// entity types will have performed this check in self::applies().
if (strpos($definition['type'], 'entity:{') === 0) {
......
......@@ -53,6 +53,10 @@ public function testCommentInterface() {
$comment = $this->postComment($this->node, $comment_text);
$this->assertTrue($this->commentExists($comment), 'Comment found.');
// Test that using an invalid entity-type does not raise an error.
$this->drupalGet('comment/reply/yeah-this-is-not-an-entity-type/' . $this->node->id() . '/comment/' . $comment->id());
$this->assertSession()->statusCodeEquals(404);
// Test the comment field title is displayed when there's comments.
$this->drupalGet($this->node->toUrl());
$this->assertSession()->responseMatches('@<h2[^>]*>Comments</h2>@');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment