Module shouldn't assume use of entity data table

Created on 1 June 2020, over 4 years ago
Updated 26 February 2024, 9 months ago

Problem/Motivation

I'm using this module on a site with several custom entities. One of those entities does not declare a data table, only a base table. When I created a view using a custom views table with a relationship to that entity, the table was blank in the views query, resulting in an error.

To recreate this:

  1. Create a custom entity that only uses a base table.
  2. Create a custom table in the database with an numeric column that references the IDs fo the custom entity
  3. Add the custom database table as a Views Custom Table, and assign the correct column for the custom entity relationship
  4. Create a view with a base table of the views custom table
  5. Add a relationship to the custom entity
  6. You should see the LEFT JOIN created by the relationship is trying to join a table without a name

Proposed resolution

Check if the data table is defined when adding the relationship to views, and if not, use the entity base table.

Remaining tasks

Reviews needed

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

None

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States averagejoe3000 Swanzey, NH

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024