Details
-
Type:
Bug
-
Status:
Awaiting Feedback
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.3
-
Fix Version/s: None
-
Component/s: ORM
-
Security Level: All
-
Labels:
-
Environment:Hidecomposer.json require :
"php": ">=5.3.3",
"symfony/symfony": "2.1.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "dev-master",
"twig/extensions": "dev-master",
"symfony/assetic-bundle": "dev-master",
"symfony/swiftmailer-bundle": "dev-master",
"symfony/monolog-bundle": "dev-master",
"sensio/distribution-bundle": "dev-master",
"sensio/framework-extra-bundle": "dev-master",
"sensio/generator-bundle": "dev-master",
"jms/security-extra-bundle": "1.2.*",
"jms/di-extra-bundle": "1.1.*",
"twitter/bootstrap": "master",
"friendsofsymfony/rest-bundle": "dev-master",
"doctrine/doctrine-fixtures-bundle": "dev-master"Showcomposer.json require : "php": ">=5.3.3", "symfony/symfony": "2.1.*", "doctrine/orm": ">=2.2.3,<2.4-dev", "doctrine/doctrine-bundle": "dev-master", "twig/extensions": "dev-master", "symfony/assetic-bundle": "dev-master", "symfony/swiftmailer-bundle": "dev-master", "symfony/monolog-bundle": "dev-master", "sensio/distribution-bundle": "dev-master", "sensio/framework-extra-bundle": "dev-master", "sensio/generator-bundle": "dev-master", "jms/security-extra-bundle": "1.2.*", "jms/di-extra-bundle": "1.1.*", "twitter/bootstrap": "master", "friendsofsymfony/rest-bundle": "dev-master", "doctrine/doctrine-fixtures-bundle": "dev-master"
Description
I tried to use the findBy method with limit and offset parameters against an Oracle database using oci8 driver.
The query seems to executed successfully but the hydrator fails when hydrating data as there is a DOCTRINE_ROWNUM column appending the "limit" clause.
Here is the exception thrown : "Notice: Undefined index: DOCTRINE_ROWNUM in [...]/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php line 183"
I was thinking about something like this to fix this issue
:
- add an attribute (platformExtraColumns) to the platform class, storing every column added by methods like doModifyLimitQuery
- check in hydrator method hydrateRowData if the column exists among the extra columns attribute of the custom platform
- don't use the column if true
Maybe there is a better approach, what are your thoughts?
I implemented it in my forks :
https://github.com/benja-M-1/doctrine2/commit/c8d899b14446accf869ddc0043f4235284375755
https://github.com/benja-M-1/dbal/commit/b9423c8d46a2bcdaa5a1f0b26a9a28259b1e44a2
It works for me, but I didn't write unit tests.