Problem/Motivation
When we added support for interface translation in Lingotek (#2924541: Add support for interface translation strings), we reused the same render elements used for content entities, but without passing an entity.
The preprocess in this module assume there is an entity, and that's used for changing the link so we avoid calling the TMS and use the own provided routes for copying from source.
Steps to reproduce
Enable potx and lingotek_copy_source, and visit the interface translation from Lingotek module.
Proposed resolution
For now, we just need to avoid the WSOD.
Ideally, we would want to copy from the source language in interface translation as we do with content. But interface translations don't have profiles associated, which is were we are storing the copy source configuration. So we may tackle that, but as a different issue.
Remaining tasks
Fix. Add tests.
User interface changes
No WSOD would be great :-P
API changes
None.
Data model changes
None.
Comments
Comment #3
penyaskitoCrediting Charlie for reporting it.
Comment #4
penyaskitoAttached patch with tests.
Comment #5
penyaskitooops missed the group in tests and the testbot doesn't like that.
Comment #8
penyaskitoNot sure if the testbot would like this or I need to commit the info.yml changes separately.
Comment #12
penyaskitoRe-testing #5
Comment #13
penyaskitoOops, that test depends on the index of the module, and sadly this modules comes first, and we cannot alter that with the current test.
I'm just going to copypaste the test so we don't depend on a concrete (and yet unreleased) version ¯\_(ツ)_/¯
This patch also includes the changes in
\Drupal\lingotek_copy_source\Controller\LingotekNotificationControllerso we handle correctly the interface translation callbacks.Comment #16
penyaskitoSpotted a bug!
Comment #19
penyaskitoInterface translation will return always NULL as the profile, so we need to check for that.
Comment #22
penyaskitoWe don't want to automatically request translations neither with a null profile.
Comment #24
penyaskitoTests passed and failed as expected.
Comment #26
penyaskitoCommitted 382516f and pushed to 1.0.x. Thanks!