Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    I spotted that earlier on and tried it but it gave me a Drupal\Component\Plugin\Exception\PluginNotFoundException: The "\Drupal\mymod\Form\EventForm" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 130 of core\lib\Drupal\Core\Entity\EntityTypeManager.php). I assumed that it was still looking for an '<entity>.<operation>' format as in the getEditFromRoute, instead of the form path as in your suggestion? Commented Feb 12, 2016 at 20:13
  • 1
    ok so just tried the above with entity.comment.edit_form re routed to my form extending CommentForm this time. Just incase something in Product Entity setup is causing it to fail - but I am getting a access denied on trying to access edit form - confused?! Commented Feb 13, 2016 at 20:27
  • This is a wrong answer. The '_entity_form' should be something like 'commerce_product.some_operation'. Using a class won't work. You can check setParametersFromEntityInformation() that is expecting to get the entity type from the '_entity_form' value and it will fail and that is why like this it may happen the access denied as @Mathew said. Commented Dec 3, 2024 at 2:59