Given a translated node is embedded inside another translated node, double check that the embedded node is displayed with the same language as the parent node. Also double check that tweaking the data-langcode attribute modifies the embed as well.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 2576983-8.patch | 3.92 KB | wim leers |
| #8 | interdiff.txt | 4.9 KB | wim leers |
| #6 | 2576983-6.patch | 3.64 KB | phenaproxima |
Comments
Comment #2
dave reidComment #3
dave reidComment #4
wim leersSimilar to #2560787-3: Add tests for entity access.
Comment #5
wim leers#2328659: Convert all existing entity_embed tests from WebTestBase to BrowserTestBase landed, unblocking this!
Comment #6
phenaproximaHere's a basic, albeit sloppy, test. There is still a lot of clean-up needed, and I'd love to know what edge cases need to be covered as well.
Comment #7
wim leersYay, thanks for getting this started! Will review tomorrow.
Comment #8
wim leersBasically only nits!
s/$node/$host_entity/
s/$translation/$host_entity_translation/
This is a test. Tests should be as simple and readable as possible. Using APIs to compute the URL is the wrong thing to do here. Hardcoding the expected URL is perfectly appropriate.
So we can remove the 3 commented lines and the todo.
👍
This also proves that no explicit cache invalidation was necessary; thereby confirming that Entity Embed already is bubbling the appropriate cacheability! 🎉
This is missing a comment. Something like:
// Now make the Portuguese translation of the host entity use the data-langcode attribute to refer to a specific translation of the embedded entity.Nits addressed.
Comment #9
phenaproxima+1 on the cleanup. Thanks!
Comment #11
wim leersComment #13
wim leersWe missed one aspect here: if the translation for the specified
data-langcodedoes not exist. #3027445: Add tests to ensure `data-langcode` works when that translation does not exist; should fall back to default translation was filed for that edge case.