Looks like we need to change the form language in the handler, then entity_language() returns that language and pathauto just magically works.

Comments

berdir’s picture

Status: Active » Needs review
StatusFileSize
new1.17 KB

See patch.

miro_dietiker’s picture

Status: Needs review » Needs work

Uff :-) How did you find this solution?! ;-)

BTW: Are we able to test such a thing with a pathauto based test and dummy translator?

+++ b/sources/entity/tmgmt_entity.plugin.incundefined
@@ -41,9 +41,12 @@ class TMGMTEntitySourcePluginController extends TMGMTDefaultSourcePluginControll
+    // Change the active language of the entity to the source language.
...
+    $handler->setFormLanguage($job_item->getJob()->target_language);

You're confusing me here. Setting target_language and the comment states "source language"? ;-)
I guess target language is right!

berdir’s picture

@plach pointed me in the right direction.

Yep, should be possible to test it, however, we need to add pathauto as a test_dependency and that will only get picked up after we create a new release or ask rfay/jthorson to trigger a dependency update manually.

berdir’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new3.59 KB

Here we go, tests :)

Testbot won't pick this up so it's pointless to add a test-only patch but I verified locally that this fails currently and passes with the patch.

miro_dietiker’s picture

Visually looks great.

berdir’s picture

Status: Needs review » Fixed

Commited.

Status: Fixed » Closed (fixed)

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