follow up to #2901939: Move the variations form to its own tab next to (Product) Edit.

With variations in their own tab, we need to ensure the content translation UI works. There's several isues

* Route generation provided by content_translation does not work since variations lack a canonical link template
* Link generation within content_translation dies since we require a {commerce_product} parameter, and links are somehow not being generated off of the variation.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mglaman created an issue. See original summary.

mglaman’s picture

FileSize
7.94 KB

This doesn't quite work, but it is a start. The content translation overview must be manually building routes rather than toUrl() with a proper rel.

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Symfony\Component\Routing\Exception\MissingMandatoryParametersException</em>: Some mandatory parameters are missing (&quot;commerce_product&quot;) to generate a URL for route &quot;entity.commerce_product_variation.content_translation_add&quot;. in <em class="placeholder">Drupal\Core\Routing\UrlGenerator-&gt;doGenerate()</em> (line <em class="placeholder">182</em> of <em class="placeholder">core/lib/Drupal/Core/Routing/UrlGenerator.php</em>). <pre class="backtrace">Drupal\Core\Routing\UrlGenerator-&gt;getInternalPathFromRoute(&#039;entity.commerce_product_variation.content_translation_add&#039;, Object, Array, Array) (Line: 293)
Drupal\Core\Routing\UrlGenerator-&gt;generateFromRoute(&#039;entity.commerce_product_variation.content_translation_add&#039;, Array, Array, 1) (Line: 105)
Drupal\Core\Render\MetadataBubblingUrlGenerator-&gt;generateFromRoute(&#039;entity.commerce_product_variation.content_translation_add&#039;, Array, Array, 1) (Line: 755)
mglaman’s picture

FileSize
8.12 KB

This gets the translation overview to render without throwing route parameter exceptions.

mglaman’s picture

Issue tags: +Needs tests

Actually, this seems to work fairly well now that the overview page was fixed. Needs tests.

mglaman’s picture

Issue tags: -Needs tests
FileSize
11.84 KB

Tests! Just need the parent issue to land.

bojanz’s picture

Priority: Normal » Major
Status: Postponed » Active

Parent issue is now in.

Increasing priority, since we now have a regression.

EDIT: Opened #3004038: ContentTranslationRouteSubscriber should not construct its own URLs and #3004037: ContentTranslationController::overview() should not construct URLs manually in core for the issues we're working around. We'll want to document them in our docblocks.

bojanz’s picture

Status: Active » Needs review
FileSize
12.78 KB

New patch, many cleanups.

  • bojanz committed 4947ac7 on 8.x-2.x authored by mglaman
    Issue #2999508 by mglaman, bojanz: Support variation translations from...
bojanz’s picture

Status: Needs review » Fixed

Manual tests were also fine. Committed #7.

Status: Fixed » Closed (fixed)

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