Details
-
Bug
-
Resolution: Duplicate
-
High
-
None
-
2014.07
-
None
-
PostgreSQL 9.2.4
Description
After upgrading CP2014.03.2 to 2014.07, I faced the following error message:
An exception occurred while executing 'SELECT id, url FROM ezurl WHERE id IN ( '' )':
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: ""
LINE 1: SELECT id, url FROM ezurl WHERE id IN ( '' )
Looking deeper in the stack trace, this is the actual exception:
CRITICAL - Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred while executing 'SELECT id, url FROM ezurl WHERE id IN ( '' )': SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" LINE 1: SELECT id, url FROM ezurl WHERE id IN ( '' ) ^"
I investigated this issue a little more and found that this error probably results from PostgreSQL (which we use on this project) seems to be picky about data types and complains about being given an empty string instead of an integer. So for a test, I tried casting $id in UrlStorage->getFieldData():
$map = $gateway->getIdUrlMap( array( (int)$id ) );
This seems to fix the issue.
Attachments
Issue Links
- duplicates
-
EZP-23544 UrlStorage::getFieldData logs an error if URL with an empty ID is not found
- Closed