Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The following error occurs when trying to edit an existing promotion -
"Uncaught PHP Exception Drupal\\Core\\Entity\\Exception\\UndefinedLinkTemplateException: "No link template 'canonical' found for the 'commerce_promotion' entity type" at /usr/src/app/web/core/lib/Drupal/Core/Entity/Entity.php line 214, referer: http://localhost/admin/commerce/promotions"
I've added a patch to add the "canonical" link for the Promotion entity type.
Comment | File | Size | Author |
---|---|---|---|
commerce-promotions-missing-canonical-link.patch | 1.15 KB | vgardner | |
Comments
Comment #2
bojanz CreditAttribution: bojanz at Centarro commentedWell that's weird. You seem to be running into an issue that was fixed in Drupal 8.3.0. What's your core version? Can you try updating it and retest?
Promotions are not meant to have a canonical link and we intentionally removed a workaround for this before RC1.
Comment #3
bojanz CreditAttribution: bojanz at Centarro commentedComment #4
司南 CreditAttribution: 司南 commentedI want to build a views to show all promotions on my site, and then it trigger this error.
I've seen that Commerce intentionally remove the canonical link for the promotion entity type, but why guy do that?
And how to implement my promotion views please ?
Comment #5
bojanz CreditAttribution: bojanz at Centarro commentedA fix was added in #2986802: Promotions can't be translated:
Comment #6
macherifI resolved this problem with file_create_url function :