Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I add the language specific field to my import, I get the right translations to the right fields, but when I click on the "translate" link, Drupal doesn't know that the node has been translated and offers me a "translate" link.
I noticed this when none of the nodes had a proper link for the translated version. When I add the translation, pathauto reacts and creates a proper link instead of /en/node/12345.
Comment | File | Size | Author |
---|---|---|---|
#5 | feeds_et-translations_not_saved-1720826-5.patch | 701 bytes | Mohammed J. Razem |
#4 | feeds_et-translations_not_saved-1720826-4.patch | 701 bytes | PascalAnimateur |
#2 | 1720826-feeds_et-translations_not_saved.patch | 792 bytes | olofbokedal |
Comments
Comment #1
stomerfull CreditAttribution: stomerfull commentedi tried module but have the same issue translation are not saved , no error appeared
thanks for your help
Comment #2
olofbokedal CreditAttribution: olofbokedal commentedI've made e small changed in the mapper, where the translations are added.
The changes will make sure that the source language is added as a translation as well, however, with the source attribute being empty, which seems to be the way that Entity Translation likes it. It will also make sure that a translation with an undefined language won't be added, and that translations won't be added if the source language is undefined.
Comment #3
PascalAnimateur CreditAttribution: PascalAnimateur commentedRe-rolled the patch against latest 1.x-dev.
Comment #4
PascalAnimateur CreditAttribution: PascalAnimateur commentedThis works well in my case, although not setting the built-in 'title' target mapping produces an empty value in node->title_original ('title' column from the node table). The same is true for the 'language' mapping, it it's not set the node->language value is also empty.
Saving the node manually once imported fixes these issues, language and title_original are properly populated from the entity_translation settings for this content type (/admin/config/regional/entity_translation).
So although the behavior is intuitive (language target has priority over entity_translation settings), the value of node->language should be set from the entity_translation settings when 'language' target is absent. As for node->title_original, this should be fixed as a special case when importing title_field (i.e. when title module is used), again based on the determined source language. Perhaps this could be tackled in another issue...
Comment #5
Mohammed J. RazemThanks PascalAnimateur.
Patch rerolled against latest dev (after closing #1648532: Undefined index: FeedsImporter in FeedsPlugin::child() when none of the fields are translatable).
Comment #6
Mohammed J. RazemPatch committed http://cgit.drupalcode.org/feeds_et/commit/?id=bf0d6d0
Comment #8
PascalAnimateur CreditAttribution: PascalAnimateur commentedIt looks like there's a problem with the repository due to the presence of the 'master' branch, i.e. the zip file is generated from this branch instead of 7.x-1.x where the commit was made and doesn't contain the patched code.
Deleting the master branch should fix the problem...