Follow-up to #1003788: PostgreSQL: PDOException:Invalid text representation when attempting to load an entity with a string or non-scalar ID

Problem/Motivation

In #1003788: PostgreSQL: PDOException:Invalid text representation when attempting to load an entity with a string or non-scalar ID, we copied historical MySQL behavior to other DBMSes (such as PostgreSQL) by clearing out non-integer entity IDs in PHP instead of relying on the database to do this. We are still silently failing though, which may be OK on production but we should warn about this on development environments and in tests

Proposed resolution

In the original issue @catch asked for an exception (which never materialized), but we have assert() now so let's add an assert() that triggers whenever we find a non-integer entity ID that is supposed to be an integer.

Remaining tasks

Review patch

User interface changes

None.

API changes

None.

Beta evaluation:
Follow-up to a critical bug, so filing as major

CommentFileSizeAuthor
#2 2564533-1.patch759 bytesstefan.r

Comments

stefan.r created an issue. See original summary.

stefan.r’s picture

Status: Active » Needs review
StatusFileSize
new759 bytes

Status: Needs review » Needs work

The last submitted patch, 2: 2564533-1.patch, failed testing.

catch’s picture

Status: Needs work » Closed (duplicate)

Duplicate of #2356943: SqlContentEntityStorage::cleanIds() hides errors but please post the patch over there.