Encrypted fields cannot be reliably used with APIs that depend on direct database value comparisons.

Because encrypted values are not stored in plain text, database-level comparisons cannot properly evaluate field values. As a result, APIs such as entityQuery(), EntityTypeManager::loadByProperties(), or direct database queries will not function as expected when filtering by encrypted fields.

This limitation should be more clearly documented to avoid developer confusion and incorrect assumptions about query behavior.

his MR updates the README.md file to clarify this limitation. The project page should also be updated to reflect the same information.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lester-barahona created an issue. See original summary.

lester-barahona’s picture

Title: Document that entityQuery-based constraints are not supported on encrypted fields » Document that encrypted fields are incompatible with entityQuery and database-level comparisons

lester-barahona’s picture

Issue summary: View changes

ptmkenny made their first commit to this issue’s fork.

ptmkenny’s picture

Priority: Critical » Minor

Changing this to "minor" as it is a documentation issue and the project page already suggests that entity query does not work in the context of field constraints. That said, this is a good clarification and I will make the change now.

ptmkenny’s picture

Assigned: lester-barahona » Unassigned
ptmkenny’s picture

Version: 4.1.0-beta1 » 4.x-dev

ptmkenny’s picture

Status: Active » Fixed
Issue tags: -Needs documentation

@lester-barahona Thank you for your contribution!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.