So I have base able of brands, with helper table of series. Series per se does not make any sence (same series number from different brands would be only misleading), so it is not a base table. and both have _has_language helper tables. I want to be able to display list of brands and series. And so far I am - almost. I can join from brand to language and get fields from brand_has_language table. And I can join to series and get SeriesIcon. But how should I describe joins to be able to display SeriesName, for example? Could I join to language the other way around? How would I write it? I have all the joins defined from time when series was a base table, and they worked then all right, I was able to display series with their language-dependent data. But it simply does not make sence for me. That's not the real logic of my model.

PS BrandName is not language dependent for purpose, it's not a bug. In case you wonder.

CommentFileSizeAuthor
Brand and series.png31.22 KBMołot
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mołot’s picture

Status: Active » Needs review

Is this a proper "by the book" solution?

   $data['series_has_language']['table']['join']['brand'] = array(
    'left_table' => 'series',
    'left_field' => 'idSeries',
    'field' => 'idSeries',
  ); 
Mołot’s picture

Status: Needs review » Needs work

OK, it was not enough. Series wasn't filtered by language. And when I added:

  $data['language']['table']['join']['brand'] = array(
    'left_table' => 'series_has_language',
    'left_field' => 'idLanguage',
    'field' => 'idLanguage',
  );

series started to be filtered by language, but the very brands stopped!

Mołot’s picture

Status: Needs work » Fixed

Custom join handler needed to keep idLanguage in order.
See also http://drupal.org/node/1966328 and http://drupal.org/node/1966648

Status: Fixed » Closed (fixed)

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

Mołot’s picture

Status: Closed (fixed) » Active

Anyone?
Is it something Views simply are not supposed to do?