Steps to reproduce
Enter "example (test)" value to any entity autocomplete field.
The following exception will be thrown.
The website encountered an unexpected error. Please try again later.
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type bigint: "test" LINE 5: ...('tags')) AND ("taxonomy_term_field_data"."tid" IN ('test')) ^: SELECT "base_table"."revision_id" AS "revision_id", "base_table"."tid" AS "tid" FROM "taxonomy_term_data" "base_table" INNER JOIN "taxonomy_term_field_data" "taxonomy_term_field_data" ON "taxonomy_term_field_data"."tid" = "base_table"."tid" WHERE ("taxonomy_term_field_data"."vid" IN (:db_condition_placeholder_0)) AND ("taxonomy_term_field_data"."tid" IN (:db_condition_placeholder_1)); Array ( [:db_condition_placeholder_0] => tags [:db_condition_placeholder_1] => test ) in Drupal\Core\Entity\Query\Sql\Query->result() (line 273 of core/lib/Drupal/Core/Entity/Query/Sql/Query.php).
Details
Drupal 10.1.x, PHP 8.2, PostgreSQL 15
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | postgres-invalid-input-syntax_3372068_6.patch | 1.42 KB | niklan |
| #2 | postgres-invalid-input-syntax_3372068_2.patch | 1.37 KB | chi |
Issue fork drupal-3372068
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
Comment #2
chi commentedComment #4
chi commentedThe alternative solution could be casting field entity ID to text in SQL query.
Comment #5
joseph.olstadHello @Chi, thank you for this fix, it works for me also. No longer a WSOD running psql with this situation .
I'm not quite sure on steps to reproduce in my case so I'll leave yours as it seems easier to reproduce.
This works on both psql 12 and psql 13
Fix applies to D9.5.x also.
Comment #6
niklanPatch for Drupal 10.3+
Comment #8
liam morlandThe patch in #6 would stop the error messages, but may end up hiding an underlying issue with entities that have non-integer IDs.
Comment #9
liam morland