Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I created a view with a chained relationship (see attachment):
node (type=Team) -> athlete (cck user reference) -> node (type: profile).
From the fields that are selected from the profile, only the first is retrieved correctly from the db. The following fields get the same value as the first.
The reason seems to be that the field aliases get truncated, such that they are indistinguishable.
This the sql query that is generated from the view:
SELECT node_users_node_data_field_team_athletes_node_data_field_profile_picture.field_profile_picture_fid AS node_users_node_data_field_team_athletes_node_data_field_pro,
node_users_node_data_field_team_athletes.type AS node_users_node_data_field_team_athletes_type,
node_users_node_data_field_team_athletes.nid AS node_users_node_data_field_team_athletes_nid,
node_users_node_data_field_team_athletes.vid AS node_users_node_data_field_team_athletes_vid,
node_data_field_team_name.field_team_name_value AS node_data_field_team_name_field_team_name_value,
node.type AS node_type,
node.nid AS nid,
node.vid AS node_vid,
users_node_data_field_team_athletes.name AS users_node_data_field_team_athletes_name,
users_node_data_field_team_athletes.uid AS users_node_data_field_team_athletes_uid
FROM node node
LEFT JOIN content_field_team_athletes node_data_field_team_athletes ON node.vid = node_data_field_team_athletes.vid
INNER JOIN users users_node_data_field_team_athletes ON node_data_field_team_athletes.field_team_athletes_uid = users_node_data_field_team_athletes.uid
INNER JOIN node node_users_node_data_field_team_athletes ON users_node_data_field_team_athletes.uid = node_users_node_data_field_team_athletes.uid AND node_users_node_data_field_team_athletes.type = 'profile'
LEFT JOIN content_type_profile node_users_node_data_field_team_athletes_node_data_field_profile_picture ON node_users_node_data_field_team_athletes.vid = node_users_node_data_field_team_athletes_node_data_field_profile_picture.vid
LEFT JOIN content_type_team node_data_field_team_name ON node.vid = node_data_field_team_name.vid
WHERE node.type in ('team')
Comment | File | Size | Author |
---|---|---|---|
team-view.txt | 10.46 KB | ahallez |
Comments
Comment #1
dawehnerThis seems to be caused by #571548: Identifiers longer than 63 characters are truncated, causing Views to break on Postgres so we really need the counter/md5 solution here. This sucks.
Comment #2
MustangGB CreditAttribution: MustangGB commented