Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23324

eZURL SQL error on postgres

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: High High
    • None
    • 2014.07
    • Database related
    • 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

        Activity

          People

            Unassigned Unassigned
            mahner mahner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m