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.
In order for Feeds to support Entity translation, and have field translations import properly, Entity translation must record the translations in its own database table. This ticket makes the translation-saving possible.
The Feeds initiative to handle all of this is #1183440: Multilingual Feeds - Make field import language-aware.
As soon as #1362378: Provide entity post-save hook gets committed, the code will get activated, but the code for this can be committed at any time without having to wait for it.
Comment | File | Size | Author |
---|---|---|---|
#8 | record_translations_created_by_feeds-1364070-6.patch | 2.63 KB | colan |
#6 | record_translations_created_by_feeds-1364070-6.patch | 2.66 KB | colan |
#2 | record_translations_created_by_feeds-1364070-2.patch | 2.72 KB | colan |
#1 | record_feeds_translations-1364070-1.patch | 2.84 KB | colan |
Comments
Comment #1
colan...and here they are.
Comment #2
colanMismatch with latest dev branch, re-rolling.
Comment #3
plach@Colan:
Would you please update the issue summary to provide a bit more context for this issue?
Quick code review:
Please rename this file to entity_translation.feeds.inc, "translation.handler.*.inc" files are supposed to hold classes implementing the
EntityTranslationHandlerInterface
.Can we have a single line here?
Core does not use space padding.
There are also some empty balnk lines around that should be removed.
Comment #4
rtdean93 CreditAttribution: rtdean93 commentedGoal: Using Drupal 7, use feeds import to upload single CSV file to populate multilingual commerce shopping systems.
Modules Used:
-Feeds - Used to import files to content or products
-Entity - Creates products via Commerce
-Entity Translate - Translates entities - used instead of/in conjunction with Multilingual Content (which only translates Nodes)
-Title - Replaces default title filed with one that is translatable (since Entity Tranlsate does not accomplish this)
-i18n (International)
Patches Applied
- Make Imports Language Aware - Changes the import form to assign languages
- Add Entity Save Hooks < broken on latest dev release -
- Record Translations created by Feeds
Prerequisites/Config:
-Title (When mapping, select the second "Title" in the list. The first one is the core one not provided by the Title module.)
-Entity translation
-Multilingual content (Both options "Set current language as default for new content" and "Require language (Do not allow Language Neutral)" need to be checked in the Multilingual settings of each content type being imported.)
Testing:
-entity_translation 7.x-1.0-alpha1, entity 7.x-1.0-rc1, i18n 7.x-1.3,
-Feeds - Dec 7 commit
Successes:
-Feed import form is language aware and Product language fields are mapping.
Issues:
-Products are being created as Language Neutral instead of the sites default language. When I save it as English, I get a translate tab... then each additional language is pre-filled with the appropriate fields.
-Product Titles are blank in the Products list... appears Title module is not overriding Product-Title.
-Product Displays are not behaving this way. Since they are originally nodes, they are being created in the site’s default language, but when I click on the translate tab and try to create a new translation, they fields are not pre-populated with the language field.
Any help is appreciated... I’ve been at this for a few weeks and my brain is quite tired.
Comment #5
colan@plach: Thanks for the review. I cleaned up the description. Leaving as needs work, as I don't have time to work on this right now. The Feeds hook names are in the process of changing, so it will also need a re-roll for that reason.
Comment #6
colanFixes for the above are included. The hook names are now correct, although the post-save one hasn't been added to #1362378: Provide entity post-save hook yet. When it is added, this will work.
Comment #8
colanSorry. Function headers were off.
Comment #9
rtdean93 CreditAttribution: rtdean93 commentedThanks for this... funny - I am getting no errors with all of the patches applied, but its not working still... Its just importing the English (default) language for Product Displays and still mapping the correct language fields for products (an entity)
Looks like the only thing thats not working is that pesky post-save hook. I'm using a dev release of Feeds from Dec 7 and have applied the patch for the feeds processor - but no luck. Is there any direction you can give me as I try to tackle this?
Comment #10
colan@rtdean93: I updated #1362378: Provide entity post-save hook for you. There should now be enough info in there for you to come up with a new patch for it. Thanks! Sorry about my lack of time right now.
Comment #11
rtdean93 CreditAttribution: rtdean93 commentedI understand lack of time - and appreciate your guidance.
I have been working on this all day and continue to have trouble... Here's my snapshot...
Entity Translation - Feb 13 Dev release plus patch from #8
Title Module - Dev and patched to remove the watchdog warning
I am using feeds with a node processor to import a csv file. to test this, I created a brand new content type with only a title field. I have enabled the title module for that field and the feed mapper is mapped to an English and French translation. I have also set the node translation type to Multilingual Support with Field Translation.
First of all - I don't think my hooks are being run... I have added watchdog functions as shown...
But no result are being fired. I have created a custom module to test the hook and it is working.
I do have positive news - after import the nodes are in the defaul language. When I click on the translate tab, no translations exists, but when I add a translation, the fields are pre-populated with the french title.
So - its clear to me - that this post save hook remains my next step.. but its hard to debug if I can't even make sure the presave (and new postsave) hook are being fired.
One more thing - I have a pending issue at Undefined property in node translation handler which is not resolved, but I think related. The #1362790: Undefined property: stdClass::$title in title_entity_update() patch correted the Title, but I still get the error for other translated fields.
Again, guidance is appreciated.
Comment #12
trebormcTagging.
Comment #13
Mohammed J. RazemI'm sorry I had to do this in a separate module. Feeds: Entity Translation
Comment #14
plachOk, let's close this then.
Comment #14.0
plachMade description clearer.