Problem/Motivation

Content translation assumes that an entity will have a canonical link. This builds a hreflang based on the current language. Promotion entities do not specify a canonical link, causing a fatal error when content translation is enabled.

Proposed resolution

  1. Use the patch from #2479377: content_translation_page_attachments() should check for a canonical link before generating a URL to it to fix the bug until it is committed to core
  2. Provide a canonical URL to promotions that is an edit URL

Remaining tasks

Decide best approach. Write tests. Implement.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

CommentFileSizeAuthor
#5 promotion-not-translatable.png26.08 KBshermiep
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mglaman created an issue. See original summary.

  • bojanz committed 1292c5e on 8.x-2.x
    Issue #2826693: Content translation breaks the promotion forms
    
bojanz’s picture

Status: Active » Fixed

Hopefully we can revert this when the core issue lands.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

shermiep’s picture

Commerce Promotion entity is not translatable, showing N/A in content translation configuration.
drupal version 8.7.3 & commerce version "8.x-2.13+30-dev"
Screenshot attached.

Solution for issue : add entity canonical link to promotion entity.
https://www.drupal.org/project/drupal/issues/2479377 issue patch is fixed in drupal core.