Following on from #2772673: Provide tokens for referenced entities in the active language., there are two more formats of tokens that weren't covered, so need test coverage and switching to be in the right language:

[node:field_name] [node:field_name:delta]

These will currently just be replaced into the default language of the entity, rather than the active language.

I'll try & find time to make a patch, but anyone else is welcome to get there first, as I can't guarantee I can.

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

james.williams created an issue. See original summary.

james.williams’s picture

I'm expecting this test to fail and show the current bug. Sorry if I've gone a little overboard in testing more token format combinations than necessary, but I think they're all worth doing?

james.williams’s picture

Status: Needs review » Needs work

(Status was just to get testbot acting, as a fix is still needed.)

james.williams’s picture

Ok, so that was a different fail to what I was expecting! What do I need to do to test the [node:field_name] style token, as opposed to [node:field_name:entity]?

james.williams’s picture

Sorry if this is just wrong and adds to the noise, but I'm surprised to see the entity_reference module isn't enabled for the test, is that the problem?

Status: Needs review » Needs work

The last submitted patch, 5: token-multilingual-references-2858419-5.patch, failed testing.

james.williams’s picture

That wasn't the issue then, sorry.

james.williams’s picture

Sorry again for the noise. I've got set up for running tests locally now - this test should run as expected (i.e. failing), to demonstrate the bug (that the title of the original translation is shown rather than the translation's title).

(Note that the 'access content' permission is actually needed for these tokens to work, I trust that I've gone about testing using it in a sensible way. At the very least, I trust that this test demonstrates the bug, even if the test itself might need tweaking!)

james.williams’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: token-multilingual-references-2858419-8.patch, failed testing.