Created a Node (Article) before enabling Content Translation. Then started a translation request (EN->DE) with the MS translator.
Reviewing the translation results in an error:
Drupal\Core\Entity\EntityStorageException: Invalid translation language (und) specified. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 757 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\content_translation\FieldTranslationSynchronizer->synchronizeFields(Object, 'de', 'und')
content_translation_entity_presave(Object)
etc.
The patch prevents this error.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | set_source_language_in-2593509-13.patch | 2.65 KB | thenchev |
| #13 | interdiff-2593509-13.txt | 883 bytes | thenchev |
| #11 | set_source_language_in-2593509-11.patch | 2.1 KB | thenchev |
| #11 | interdiff-2593509-7-11.txt | 1.28 KB | thenchev |
| #9 | set_source_language_in-2593509-9.patch | 1.26 KB | thenchev |
Comments
Comment #3
mpp commentedTested the patch, while it does fix the issue, it also breaks the tests.
Setting to major as I get this when translating an article with an image on a standard Drupal 8 installation.
@cgalli, can you provide me your translation config? I can only reproduce it when I mark "Article" and its image's "Alt" & "Title" as translatable.
Comment #5
berdirComment #6
thenchev commentedComment #7
thenchev commentedRe-uploading patch to see what tests are failing.
Comment #9
thenchev commentedI might need some more info on this. Here are the steps i tried:
1. Clean drupal install
2. Create node(s) type article
3. Install content entity source
4. Install Microsoft Translator
5. In admin/config/regional/content-language check article
6. In admin/tmgmt/sources request translation
Here i get a fatal but not the one described, i get:
Fatal error: Call to a member function getName() on a non-object in /var/www/html/modules/tmgmt/src/TranslatorPluginBase.php on line 61
target language is here null in case only one language is currently defined.
witch i fixed with this patch
7. Adding second language
other then that can't seem to get any other fatals. Maybe someone can confirm?
Comment #10
mpp commentedThe issue remains using Drupal 8.0.5 Standard profile. Make sure the article has an image with an alt text and enable "Image", "title" and "alt" on admin/config/regional/content-language.
After further investigation it seems this might be an issue related to the plugin system, it only occurs when "Auto accept finished translations" is enabled.
Steps to reproduce:
Comment #11
thenchev commented@mpp thanks for the details, yes there is an issue and the patch fixes it.
Lets see if this fixes the tests.
Comment #12
berdirTest fix looks good, but I'd like to see explicit test coverage for this now.
Should be pretty easy, at the end where we test the stuff, just do the same getTranslationMetadata($translation) call and check getSource().
Comment #13
thenchev commentedExpanded test coverage.
Comment #15
berdirThanks. committed.
@mpp: While this is definitely something that we were not doing properly, core IMHO really shouldn't fail so bad. I'd suggest you open a core issue to make core more resilient.