Details
-
Bug
-
Resolution: Unresolved
-
High
-
None
-
1.7.9, 1.13.5, 2.5.2, 3.0.0-beta1
-
None
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
Issue Links
- discovered while testing
-
EZP-30600 As a Developer I want to use Symfony's EventListeners instead of SignalSlots
- Closed