You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Doctrine ORM 2: readonly entity properties fail with the legacy proxies #166
composer.json allows doctrine/orm^2.20 || ^3.5, but the entities have readonly properties since v3.2: ProcessExecution::$code, $startDate, $logFilename, and LogRecord::$channel, $level, $message, $context, $createdAt, $processExecution.
With Doctrine ORM 2 and its legacy proxies (doctrine/common proxy generator, i.e. DoctrineBundle 2 without doctrine.orm.enable_lazy_ghost_objects: true), creating a proxy of these entities fails, e.g. when a LogRecord is loaded with its processExecution relation:
Cannot unset readonly property CleverAge\UiProcessBundle\Entity\ProcessExecution::$code
from scope Proxies\__CG__\CleverAge\UiProcessBundle\Entity\ProcessExecution
Found by the lowest dependencies CI job of #164 (PR #165): requiring the PHP polyfills made --prefer-lowest resolve doctrine/orm 2.20.0 instead of 3.6.0, and 2 tests of LogRecordCrudTest failed. The test kernel now enables the lazy ghost objects on ORM 2 (tests/App/TestKernel.php, as the DoctrineBundle 2 Symfony recipe does), but an application on ORM 2 without this setting gets the error (log records list, execution details...).
Proposed fix
Two options, to decide:
Keep ORM 2 support: document the requirement (doctrine.orm.enable_lazy_ghost_objects: true with ORM 2, set by the Symfony recipe of DoctrineBundle 2.x) in the installation documentation, and fail early with an explicit message, e.g. a check when the container is compiled (ORM 2 detected and lazy ghost objects disabled), instead of the PHP error at runtime.
Drop ORM 2: require doctrine/orm^3.5 (ORM 2 only gets security fixes), remove the test kernel workaround and simplify the CI matrix. This is a dependency change: applications still on ORM 2 must stay on ui-process-bundle 3.2 or upgrade Doctrine.
Requirements
Documentation updates
Reference
Changelog
Unit tests
Breaking changes
Option 1: none. Option 2: applications on Doctrine ORM 2 can no longer install the next version (to be released in a minor version only if considered acceptable, since ORM 2 setups without lazy ghost objects are already broken since v3.2; otherwise in the next major).
Activity
Merge pull request #167 from cleverage/166