Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294396

Views don't joint the right table for relationships with long table names

$
0
0

Problem/Motivation

I juste spent a few hours trying to figure out what was wrong but without success.

Given I have a field_interpretation_target on a field_collection_item, the base table of this field is not field_collection_item__field_interpretation_target but something link field_collection_item__8283872305 (see \Drupal\Core\Entity\Sql\DefaultTableMapping::getDedicatedDataTableName).

The thing is that, for some reason, Views keeps using the default table name so it leads to a fatal error :

        field_interpretation_target:
          id: field_interpretation_target
          table: field_collection_item__field_interpretation_target
          field: field_interpretation_target
          relationship: field_interpretations_value
          group_type: group
          admin_label: Target
          required: true
          plugin_id: standard

Proposed resolution

After my investigation I found that something was happening in \Drupal\views\Plugin\views\relationship\RelationshipPluginBase::query probably around $def['left_table'] = $this->tableAlias;

Remaining tasks

Figure out what's happening
Write a test to demonstrate the issue
Fix the problem
Review
Commit
Enjoy

User interface changes

None.

API changes

None.

Data model changes

None.


Viewing all articles
Browse latest Browse all 294396

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>