SQL JOIN column name error

Created on 13 February 2020, over 5 years ago
Updated 3 July 2025, 1 day ago

Hi,

I create a 3 custom entity type with drupal console :
Pokemon with reference to Pokemon type and Pokemon generation entities (to store informations from https://pokeapi.co/about.html)

2 tables was created for the entity reference : pokemon__pokegeneration & pokemon__poketype.
They contain pokegeneration_target_id & poketype_target_id to store ID from entity reference.

When I use VERF filter the SQL join the bad column name

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'pokemon__pokegeneration.pokegeneration_pokegeneration' in 'where clause': SELECT pokemon.id AS id FROM {pokemon} pokemon LEFT JOIN {pokemon__pokegeneration} pokemon__pokegeneration ON pokemon.id = pokemon__pokegeneration.entity_id AND pokemon__pokegeneration.deleted = :views_join_condition_0 WHERE pokemon__pokegeneration.pokegeneration_pokegeneration IN (:db_condition_placeholder_1) LIMIT 11 OFFSET 0; Array ( [:db_condition_placeholder_1] => 1 [:views_join_condition_0] => 0 )

pokemon__pokegeneration.pokegeneration_pokegeneration instead of pokemon__pokegeneration.pokegeneration_target_id is used.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France JΓ©rΓ΄me Dehorter Lille

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.

  • πŸ‡©πŸ‡ͺGermany ktpm

    Same issue here on a custom entity with a entity reference base field. I can confirm that either patches work. The filter(s) need to be re-attached when switching between them though.

Production build 0.71.5 2024