EntityQuery exists fails with unknown column name

Created on 12 November 2021, about 3 years ago
Updated 6 April 2023, over 1 year ago

Problem/Motivation

Field definitions stating NULL as mainPropertyName produce a non-working query when using exists.

This leads to a failure when doing de/encrypt field configuration changes, and the entities are not queued for processing.

FE an address field, see the corresponding issue there #3250973: Compatibility With Entity Query Field Exists Method β†’

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'the_entity__field_entity_address.field_entity_address_' in 'where clause'

Steps to reproduce

- Add an address β†’ field to a bundle.
- Change change the field's storage settings and enable encryption.

- Or an entity query for the entity type the bundle belongs to.
- And add $query->exists($field_name); to the query before running.

Proposed resolution

This should be addressed in core IMO. No issue yet.
The approach seems to be introducing a possibility to alter the entity query, see πŸ“Œ Add an alter hook to EntityQuery RTBC ,
which then would need to be implemented by a module using NULL as mainPropertyName.

Right now we can only provide a workaround ...

πŸ› Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States destinationsound

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