Hi,

Not sure if this is the right queue to post this issue, it could also be related to the entity_translation module.

case:
I have a multilingual drupal commerce set-up, using the entity_translation module with 3 languages(fr, nl, en).
When I create a product, i want this product to show up for the correct language if there is a translation for the correct language otherwise I don't want the product to be displayed at all.

issue:
I created a view that lists all products with 2 relations:

  1. Content: Referenced product (works fine)
  2. Commerce Product: Entity translation: translations (throws a mysql syntax error)

I added a picture of the view I created together with the error.

Sincerely,
Dimitri

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rszrama’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Priority: Major » Normal
Status: Active » Closed (won't fix)

Yeah, that isn't something we have the expertise to address in here. If you haven't already cross-posted to the Entity Translation queue, please reopen this issue and move it to that queue.

dimitrileonidas’s picture

Project: Commerce Core » Entity Translation
Version: 7.x-1.x-dev » 7.x-1.0-beta2
Status: Closed (won't fix) » Active
fabsor’s picture

Title: Adding 'Commerce Product: Entity translation: translations' as relationship generates mysql syntax error » SQL error in Views when adding an entity translation relationship that is not using the base entity of the view

I can confirm this bug, and it only occurs when you add an entity translation relationship to an entity that is not the base entity type for a view.

fabsor’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
646 bytes

It seems like we must use the table alias for the left table in order for the relationship to work with more complex queries. This patch should do the trick.

plach’s picture

Category: support » bug
dimitrileonidas’s picture

This worked just fine! Thanks a lot!

dimitrileonidas’s picture

Status: Needs review » Patch (to be ported)
plach’s picture

Status: Patch (to be ported) » Fixed

Committed and pushed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 2e4fa0b on 7.x-1.x, factory, et-fc, revisions authored by fabsor, committed by plach:
    Issue #1903024 by fabsor | dimitrileonidas: Fixed SQL error in Views...

  • Commit 2e4fa0b on 7.x-1.x, factory, et-fc, revisions, workbench authored by fabsor, committed by plach:
    Issue #1903024 by fabsor | dimitrileonidas: Fixed SQL error in Views...