Problem/Motivation

Despite #2068655: Entity fields do not support case sensitive queries starts with "It is impossible to convert condition('name', db_like($name), 'LIKE') in user_is_blocked" whoever converted to UniqueFieldValueValidator::validate have managed to convert it by simply copying over db_like and LIKE as an operator. *slowclap*

Proposed resolution

Just remove, the issue linked makes this unnecessary.

File a followup that throws the book on whoever tries this next.

CommentFileSizeAuthor
eq_is_not_sql.patch882 byteschx

Comments

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Looks great

chx’s picture

Title: UniqueFieldValueValidator condition is gibberish » UniqueFieldValueValidator condition is invalid EntityQuery
fabianx’s picture

RTBC + 1

Status: Reviewed & tested by the community » Needs work

The last submitted patch, eq_is_not_sql.patch, failed testing.

Status: Needs work » Needs review

Fabianx queued eq_is_not_sql.patch for re-testing.

fabianx’s picture

Status: Needs review » Reviewed & tested by the community

Testbot fail

alexpott’s picture

Status: Reviewed & tested by the community » Needs review

Are we missing test coverage or does this work by accident atm?

chx’s picture

Status: Needs review » Reviewed & tested by the community

Accident. It leaks the operator into sql query. I suggested a followup to throw exception if the operator is invalid.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 0cfeca1 and pushed to 8.0.x. Thanks!

  • alexpott committed 0cfeca1 on 8.0.x
    Issue #2461523 by chx: UniqueFieldValueValidator condition is invalid...

Status: Fixed » Closed (fixed)

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