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

SPI Location Value Object id property is a string

    XMLWordPrintable

Details

    Description

      The \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::create method creates an instance of \eZ\Publish\SPI\Persistence\Content\Location. Its id property is later on, in the same method, initialized with the value of DatabaseHandler::lastInsertId which by underlying Doctrine's definition could be a string.

      This assumption however does not make sense neither for our domain nor for our storage. Location id is always going to be an int for us (cannot be stored in a db otherwise), so it should be casted.

      This probably applies to all usages of lastInsertId.

      The issue is quite visible when propagating whole Value Object through EventDispatcher, which Subscribers rely on strict typing. The more we will apply strict typing, the more of an issue it will become.

      Attachments

        Activity

          People

            andrew.longosz@ibexa.co Andrew Longosz
            andrew.longosz@ibexa.co Andrew Longosz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: