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:

Files: 
CommentFileSizeAuthor
#17 commerce_product-integrate-entitycache-1157446-17.patch2.97 KBdas-peter
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch commerce_product-integrate-entitycache-1157446-17.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
commerce_product-integrate-entitycache.patch2.71 KBdas-peter
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch commerce_product-integrate-entitycache.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

Status:Needs review» Needs work

Do 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.

I 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.

This is not a Title-specif issue: #1165930: Compatibility with Entity API.

Subscribing to see what happens.

Subscribing to see what happens.

I 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

I get around this by updating all the cart views to use the products title field instead of the line_item title.

@guy_schneerson
the view itself would not allow me to add fields other than of type "line item" ?!!

@GiorgosK
You need to create a relationship between the line item and the product, its under the advanced section of the view.

@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

GiorgosK: make sure you are using the correct title field, you are using the node title you should be using the title field

@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?

@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.

@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"

@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

@das-peter

The patch couldn't be applied on the latest Commerce. The problem comes at the last chunk:

-class CommerceProductEntityController extends DrupalDefaultEntityController {
+class CommerceProductEntityController extends EntityCacheDefaultEntityController {

as CommerceProductEntityController now extends DrupalCommerceEntityController, not DrupalDefaultEntityController.

Status:Needs work» Needs review
StatusFileSize
new2.97 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch commerce_product-integrate-entitycache-1157446-17.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Rerolled. 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:

Do we really need to introduce a dependency on EntityCache?

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.

@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.

The last submitted patch, commerce_product-integrate-entitycache-1157446-17.patch, failed testing.