When adding and viewing a new View for listing entity_subqueue entities, the following fatal error occurs:
Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: No link template 'canonical' found for the 'entity_subqueue' entity type in Drupal\Core\Entity\Entity->toUrl() (line 225 of /var/www/drupal8/php/web/core/lib/Drupal/Core/Entity/Entity.php).
Adding the canonical link to the entity links definition fixes the issue.
* links = {
* "canonical" = "/admin/structure/entityqueue/{entity_queue}/{entity_subqueue}",
* "edit-form" = "/admin/structure/entityqueue/{entity_queue}/{entity_subqueue}",
* "delete-form" = "/admin/structure/entityqueue/{entity_queue}/{entity_subqueue}/delete",
* "collection" = "/admin/structure/entityqueue/{entity_queue}/list",
* },
Comments
Comment #2
davidwhthomas commentedHere's the patch
Comment #3
davidwhthomas commentedComment #5
davidwhthomas commentedJust noting, the test failure appears unrelated to the patch instead:
queue name & id mismatch: tests/modules/entityqueue_test/config/install/entityqueue.entity_queue.test.yml >
id: test_queueI imagine the file should be named
entityqueue.entity_queue.test_queue.ymlor the id should be just
testComment #6
davidwhthomas commentedAh, wrote too soon on this one. It fixes the error, but turns the edit form into a read-only type display.
Looks like we'll need a separate route for the canonical entity subqueue url instead of sharing the edit-form.
Comment #7
sagesolutions commentedI could not reproduce this error. I made a simple queue, and a 'multiple subqueue' entity queue. I added some content to each queue.
Next, I went to
/admin/structure/views/addand selected Entity subqueue in the "View Settings" section, and created a page.I clicked save, and went to the page, and had no issues.
I'm on the 8.x-1.x branch for entityqueue (Currently on the commit caeff5d96411a9ceceddf3d12343844eb228838f on Jul 11, 2018)
I'm running Drupal 8.5.5
Comment #8
sagesolutions commentedUpdate:
I switched to Drupal 8.6-dev, and I still cannot reproduce this bug.
@davidwhthomas, can you still reproduce this?
Comment #9
amateescu commentedDuplicate of #2862628: No link template 'canonical' found for the 'entity_subqueue' entity type. There was a core bug which fixed a similar thing: #2479377: content_translation_page_attachments() should check for a canonical link before generating a URL to it so I assume somewhere in the codebase of your project you have a similar situation with a module (or even core) which doesn't check if a canonical link template actually exists before doing its work.
Comment #10
davidwhthomas commentedThanks for the update!
I'm running v8.5.4
I'll double check it again with the custom view, perhaps ok for now.