Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Entity translation is going to have its UI heavily rewritten, see #1282018: Improve UX of language-aware entity forms.
Some of the integration code needs to be updated to catch-up with those changes.
Comment | File | Size | Author |
---|---|---|---|
#15 | commerce-et_integration-1495570-15.interdiff.do_not_test.patch | 2.02 KB | plach |
#15 | commerce-et_integration-1495570-15.patch | 9.9 KB | plach |
#14 | commerce-et_integration-1495570-14.patch | 8.19 KB | plach |
#4 | commerce-et_integration-1495570-4.patch | 3.73 KB | plach |
#1 | et-integration-1495570-1.patch | 3.58 KB | plach |
Comments
Comment #1
plachHere is a working patch. We should really wait to commit this until a tagged version of ET shipping the new UI is released because the new UI relies on a core patch. Ideally we could coordinate a joint release.
Comment #2
rszrama CreditAttribution: rszrama commentedGreat, thanks for putting the patch in the queue! : )
Comment #3
plachThe core patch and the new ET UI have been committed. Let's test this.
Comment #4
plachSmall cosmetic improvement.
Comment #5
SaxxIng CreditAttribution: SaxxIng commentedThis patch works very well on my test site. We will find it on next drupal commerce release (7.x-1.4)?
Comment #6
drasgardian CreditAttribution: drasgardian commentedAfter applying this patch I was able to successfully create translations of products.
However, I think the 'Product SKU' field shouldn't be included on the translation form, and on the node edit form it should be marked as a shared field.
There are no options on the 'Product SKU' field to configure how it is translated, like there is on other fields. But I don't see why an sku would ever need to be translated anyway, so it could probably just be forced to always be a shared field.
Comment #7
rszrama CreditAttribution: rszrama commentedYeah, SKUs should not be translated.
Comment #8
plachSKU is not a field: it is not going to be translated...
Edit: we are still figuring out UX improvements for the language-aware entity form over at #1282018: Improve UX of language-aware entity forms.
Comment #9
plachThe first Entity Translation beta will be out soon: #4 really needs to be committed once it's out, otherwise product translation is likely to stop working.
@rszrama:
If you wish we can coordinate a joint release: is there a schedule or a roadmap for Commerce 1.4?
Comment #10
plach#4: commerce-et_integration-1495570-4.patch queued for re-testing.
Comment #11
rszrama CreditAttribution: rszrama commentedI'm planning a Commerce 1.4 as soon as possible but want to clean up the queue a bit. I'd say at the outside I'm looking at October 5. It's holding up a Commerce Shipping 2.0 full release at this point, too, so I'm eager to get it out. : )
Comment #12
plachOk, meanwhile I wrote a patch for ET that will allow to greatly simplify the integration code here. Will post an updated patch soon.
Comment #13
rszrama CreditAttribution: rszrama commentedOk, thanks.
Comment #14
plachHere is a new patch heavily depending on #1280546: Introduce a language selection widget for every entity which should be committed very soon. It seems pretty stable. Reviews/tests welcome.
Edit: it has been commited right now :)
Comment #15
plachOne last patch with a couple of minor adjustments. Take it or leave it ;)
Comment #16
bforchhammer CreditAttribution: bforchhammer commentedI just tried this out but couldn't get translation of products to work properly...
I installed the commerce kickstart distribution (2.x-dev, with the demo store), added the latest versions of entity-translation and the commerce module, and applied this patch. Then I enabled ET for the "commerce product" entity type, and enabled it on some of the pre-configured "product types". I also setup language detection and added a few more languages.
Now, when I go to an existing product I can change the language from "Language Neutral" to e.g. "English", and I'd expect the "translate" to show up. Instead, the title field looses it's contents, and the translate tab does not show up. The entity form does show the "translation" vertical tab.
That's it for my first attempt, I'll try to have another look tonight. (Probably on a "clean" version, i.e. not based on the kickstart distribution).
Comment #17
plachWell, I tested the last Commerce dev, not sure about Kickstart. However the behavior you are describing might be caused by the language widget being hidden and the default language being set to LANGUAGE_NONE. This is not the intended behavior, though (see the
hook_entity_info()
changes).About Title I don't know, maybe it's related to #1157446: Integrate the module entitycache to enhance the support for title translation?
Comment #18
bojanz CreditAttribution: bojanz commentedThis shouldn't be tested with Kickstart v2, because Kickstart relies on Inline Entity Form to handle products, and Inline Entity Form has known problems with Entity Translation (on my todo list ;))
I'll test this patch today.
Comment #19
plach@bojanz:
Thanks! The latest ET dev provides a language selector widget for every entity type it supports. The default settings for Commerce products are to show the widget and set the default language to
LAGUAGE_NONE
, to preserve the old behavior. If you experience the same problems Benedikt had (I didn't) be sure to check the entity translation settings.Comment #20
bforchhammer CreditAttribution: bforchhammer commentedI just tried it again, this time with just the commerce module (not kickstart), and I didn't run into any of the problem mentioned in #16; the translate tab shows up, adding a translation and switching between them works; shared/original fields are hidden/shown depending on permissions.
One minor thing: the "Product SKU" and "Status" fields are not marked as "shared fields" (i.e. no "translatability clue") but are treated as them (i.e. changes in one language affect the other language). This will need to be changed in the ET module, so as far as this patch is concerned I'd say it's RTBC :)
Edit: For the shared fields issue see #1798456-7: Hide shared form elements when the user has not the related permission.
Comment #21
rszrama CreditAttribution: rszrama commented@plach When do you anticipate a new release for the Entity Translation module? Is another alpha with this new patch out of the question?
Comment #22
plachWell, I was waiting for a couple of Media issues to be committed but they are not critical. I think we can ship in few days. Here is the roadmap:
#1624830: Plan for Entity Translation 7.x-1.0 release
The code in the dev is radically different from the alpha2 and I wanted to give the other projects the idea that we are reaching a stable status and that they can trust the API to be solid and reliable. Another alpha would be detrimental from this point of view. Not sure which patch you are referring to: if you mean #1798456: Hide shared form elements when the user has not the related permission, it's going to be part of the new release. Everything required by the patch here is already committed.
Btw, are you waiting for @bojanz to test/review this? Is there anything we can do to get this RTBC again?
Comment #23
rszrama CreditAttribution: rszrama commentedGood to know - I wasn't requesting another alpha for any particular reason, just ignorant about your roadmap. Basically, I don't want to roll a release of Commerce that depends on the dev version of another module for some functionality. I don't think that will be the case, as I anticipate at least another 1.5 weeks to get Commerce 1.4 packaged and released, so I should be able to go ahead and commit this. I'll see if Bojan beats me to a quick review. ; )
Comment #24
plachGreat news, I definitely think we should ship our new releases together. I'll stay tuned.
Moreover this should give us the time to have the Media stuff committed.
Comment #25
rszrama CreditAttribution: rszrama commentedI've applied this patch and updated to the latest Entity Translation, but I simply can't get access to a product translation tab. Am I missing something? I can't even hack commerce_product_entity_translation_tab_access() and have it return TRUE to make the tab appear or direct visit to the link work. Not sure what's goin' on.
Comment #26
plachIf ET was already installed you might need to clear the caches. Also make sure you product has not LANGUAGE_NONE as entity language.
Comment #27
rszrama CreditAttribution: rszrama commentedYeah, I'd saved it as English before trying to translate, but I'll give it another shot. I installed ET, updated / ran update.php, and obsessively cc all'ed to no avail. : P
Comment #28
plachDid you enable Commerce product translation in the Entity Translation settings? You'll find a link in the product type page below the multilingual settings.
Edit: You should also make sure you have translatable fields on you product otherwise there will be nothing to translate. However this won't prevent the translate tab from appearing.
Comment #29
rszrama CreditAttribution: rszrama commentedYep, I had turned that on, but I don't think I had translatable fields. Will give that a shot as well. : )
Comment #30
plachAny news here? :)
Comment #31
dimitriseng CreditAttribution: dimitriseng commentedIs there an update on this, as it seems to be holding up the entity translation beta?
Comment #32
das-peter CreditAttribution: das-peter commentedI gave the patch a try and it seems to work quite well.
It was deployed on our production environment today.
Comment #33
cvangysel CreditAttribution: cvangysel commentedI can confirm that this patch works fine on the dev branch of Commerce.
Comment #34
krishworks CreditAttribution: krishworks commentedyep, this patch works fine on the dev branch of commerce. without this patch, there were many errors. First, I was not able to access product listing page as detailed #1818496: Warning: Missing argument 2 for entity_translation_tab_access() and then if I edit a few products, I got access denied message.
The patch in #15 above resolves these.
good time to RTBC?
Comment #35
bforchhammer CreditAttribution: bforchhammer commentedNote: j2b has tested the patch above as well and reported on his experience in #1811956-11: Why commerce products become "Access denied"?. Following plach's suggestion, I created a documentation page based on his comment (pretty much just copy&paste at the moment); once this patch is committed it would be good if that page was updated to properly reflect the state/process of how to translate commerce products with entity translation.
Comment #36
rszrama CreditAttribution: rszrama commentedWay too many good reviews for this to wait on me finally getting an environment that can test this properly. Committing now - thanks to all for the reviews. : )
Comment #37
plachWonderful, thanks!
Comment #39
adam1 CreditAttribution: adam1 commentedI got the same issues as @rszrama: despite entity translation is enabled and product types are configured for entity translation and some fields too, the translation tab is not available on any product type! I got an up-to-date installation: drupal core 7.44, entity_translation 7.x-1.0-beta5 and commerce 7.x-1.13
Are the issues persistent 'till now? It's kind of tough for me, because I made a whole commerce-shop and now, in the end I realised translation isn't working. Any help very appreciated!
Comment #40
adam1 CreditAttribution: adam1 commentedNow i've found out what's going wrong (#39): it is a bug in the module commerce_backoffice that's enabled on my site, see here: https://drupalcommerce.org/questions/7427/cant-add-product-type