Currently there is a flaw in the translation of the title field when an entity's cache is used / reset during script execution. As far as I know atm. the basket and cart views are affected by this.
The title module provides the possibility to react on such cache usage / resets but to do so the module has to integrate the entitycache module.
CommerceProductEntityController
has to extend EntityCacheDefaultEntityController
to do so, what means that on an update existing installations will break if entitycache isn't in place. Ideas how to come around this?
The attached patch does the necessary integration but there are other open patches for the title and entitycache module that have to be committed first to make it really working:
Comment | File | Size | Author |
---|---|---|---|
#17 | commerce_product-integrate-entitycache-1157446-17.patch | 2.97 KB | das-peter |
commerce_product-integrate-entitycache.patch | 2.71 KB | das-peter | |
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedDo we really need to introduce a dependency on EntityCache? I'm not sure if that's a good idea or not, especially since we haven't been testing with it this entire time. Additionally, if we were to extend that controller, then we wouldn't be able to extend the EntityAPIDefaultEntityController as requested more generally.
Comment #2
das-peter CreditAttribution: das-peter commentedI would also prefer not to add another dependency - unfortunately I couldn't figure out a better way how to get this working :|
I'll try to take a closer look this week again.
Comment #3
plachThis is not a Title-specif issue: #1165930: Compatibility with Entity API.
Comment #4
catchSubscribing to see what happens.
Comment #5
guy_schneerson CreditAttribution: guy_schneerson commentedSubscribing to see what happens.
Comment #6
GiorgosKI can't see entity translated product title_field on the cart view
will this be solved a different way ? (not depending on entitycache ?)
it seems all the related issues have been resolved
Comment #7
guy_schneerson CreditAttribution: guy_schneerson commentedI get around this by updating all the cart views to use the products title field instead of the line_item title.
Comment #8
GiorgosK@guy_schneerson
the view itself would not allow me to add fields other than of type "line item" ?!!
Comment #9
guy_schneerson CreditAttribution: guy_schneerson commented@GiorgosK
You need to create a relationship between the line item and the product, its under the advanced section of the view.
Comment #10
GiorgosK@guy_schneerson thanks
Added relationship > Commerce Line item: Referenced product & field > field: Title
but
my product is untranslated
and my product display is translated using entity translation & title
but I can't get translated title in the cart view
any ideas
Comment #11
guy_schneerson CreditAttribution: guy_schneerson commentedGiorgosK: make sure you are using the correct title field, you are using the node title you should be using the title field
Comment #12
jkthng CreditAttribution: jkthng commented@guy_schneerson, if I use the product title, that means I have to allow annoymous users to "view product product"? Else the cart would be empty and no products will show even when I add products to the basket. Is it right?
Comment #13
jkthng CreditAttribution: jkthng commented@guy_schneerson Solved it after a couple of hours. I realised that you need to enable the permission "Translate any entity" for the annoymouse users. Hope this saves someone some time.
Comment #14
guy_schneerson CreditAttribution: guy_schneerson commented@jkthng that doesn’t sound right, an anonymous user shouldent be able to translate content under any normal circumstances.
the only relevant permission i believe is "View published content"
Comment #15
jkthng CreditAttribution: jkthng commented@guy_schneerson Oh. Then perhaps I am wrong. If I don't assign that permission the view doesn't show at all. Did I get my views right?
This is a paste bin of my shopping cart block. http://pastebin.com/a4UPWxXV
Comment #16
OnkelTem CreditAttribution: OnkelTem commented@das-peter
The patch couldn't be applied on the latest Commerce. The problem comes at the last chunk:
as CommerceProductEntityController now extends DrupalCommerceEntityController, not DrupalDefaultEntityController.
Comment #17
das-peter CreditAttribution: das-peter commentedRerolled. As I currently use to unpatched version I didn't test in detail if it's really applicable to change the
DrupalCommerceEntityController
.Further Ryans question is still very relevant:
Unfortunately I still don't know if there's a possibility to have something like a soft dependency.
Set status to needs review to see if the tests pass.
Comment #18
OnkelTem CreditAttribution: OnkelTem commented@das-peter
For me this is a case when until something gets resolved in the Right Way, we can use some temporary solution. Thank you.