Skip to content

v2.5.7

@Ocramius Ocramius tagged this 11 Aug 21:38
release of the ORM.

This patch introduces compatibility with Doctrine DBAL 2.6.x. [#6580](https://github.com/doctrine/doctrine2/pull/6580)

The most critical issue being fixed is a bug
in `Doctrine\ORM\PersistentCollection`, causing duplicate data
to be persisted when a collection is both marked as initialized
and dirty, and more entries are added to it via
the `Doctrine\Common\Collections\Collection#add()`
API. [#6613](https://github.com/doctrine/doctrine2/pull/6613) [#6614](https://github.com/doctrine/doctrine2/pull/6614)
[#6616](https://github.com/doctrine/doctrine2/pull/6616)

The return value of `Doctrine\ORM\PersistentCollection#removeElement()`
was sometimes an `object` or `null, causing some applications
to crash when PHP is run within the context
of `declare(strict_types=1);` [#6550](https://github.com/doctrine/doctrine2/pull/6550)

Memory leak issues with the hydrator process were fixed: the
hydrator object was never being garbage collected due to it
being registered with a `Doctrine\Common\EventManager` instance
to listen for the `Doctrine\ORM\Events::onClear` event. [#1515](https://github.com/doctrine/doctrine2/pull/1515)

The `Doctrine\ORM\Tools\Pagination\CountOutputWalker` was producing
invalid SQL for queries containing a `GROUP BY` clause. [#6243](https://github.com/doctrine/doctrine2/pull/6243)

The SQL generated for a DQL query containing a JTI (Joined Table
Inheritance) selection and a `WITH` clause applied to a `JOIN`
condition was invalid on PostgreSQL. [#6475](https://github.com/doctrine/doctrine2/pull/6475)

The `Doctrine\ORM\Tools\Console\MetadataFilter` was not detecting
all metadata matching the filter regular expression. [#5715](https://github.com/doctrine/doctrine2/pull/5715)

The `Doctrine\ORM\Tools\SchemaTool` was raising notices due to
invalid lookup for a discriminator column length, which may
not be defined in all mappings. [#5798](https://github.com/doctrine/doctrine2/pull/5798)

Total issues resolved: **18**

- [1515: DDC-3146 Remove `onClear` event listener from abstract hydrator in cleanup function, otherwise causing hydrator GC to not kick in](https://github.com/doctrine/doctrine2/pull/1515) thanks to @emiel-silverstreet
- [1541: Type annotation correction in `ResultSetMappingBuilder#addJoinedEntityFromClassMetadata()` `$relation` (should be `string`)](https://github.com/doctrine/doctrine2/pull/1541) thanks to @aleeeftw
- [3925: DDC-3146: Hydrator memory leak when using iterator](https://github.com/doctrine/doctrine2/issues/3925) thanks to @doctrinebot
- [4772: DDC-3914: #1515 DDC-3146 Remove event listener from abstract hydrator in cleanup function](https://github.com/doctrine/doctrine2/issues/4772) thanks to @doctrinebot
- [5715: Fix `MetadataFilter` regression after #507 (#2815) not testing filters after first one](https://github.com/doctrine/doctrine2/pull/5715) thanks to @guilliamxavier
- [5745: `PersistentCollection#removeElement()` returns `object` or `null` instead of boolean](https://github.com/doctrine/doctrine2/issues/5745) thanks to @holtkamp
- [5798: Fix undefined index for discriminator column `length` attribute in `SchemaTool`](https://github.com/doctrine/doctrine2/pull/5798) thanks to @sergeyfedotov
- [6243: Fix `CountOutputWalker` for queries containing a `GROUP BY` clause, which was producing invalid SQL](https://github.com/doctrine/doctrine2/pull/6243) thanks to @enumag
- [6362: Undefined Property error in ObjectHydrator when using JOIN WITH](https://github.com/doctrine/doctrine2/issues/6362) thanks to @SirWaddles
- [6367: Correct hydration of resultsets coming from DQL queries where the root of the selection is aliased and also the root of an inheritance](https://github.com/doctrine/doctrine2/pull/6367) thanks to @SirWaddles
- [6381: Corrected `LoadClassMetadataEventArgs` `@method` annotations to reflect actual returned types](https://github.com/doctrine/doctrine2/pull/6381) thanks to @ElisDN
- [6464: Query builder yields invalid SQL with JOINED inheritance type on PostgreSQL](https://github.com/doctrine/doctrine2/issues/6464) thanks to @stesie
- [6475: Fix invalid sql generated for CTI JOINs when INNER JOIN'ing with a `WITH` clause](https://github.com/doctrine/doctrine2/pull/6475) thanks to @stesie
- [6550: Fix return value of `PersistentCollection#removeElement()` for extra-lazy collections: should be `bool`](https://github.com/doctrine/doctrine2/pull/6550) thanks to @alcaeus
- [6580: Allow DBAL 2.6 and common 2.8 to be installed](https://github.com/doctrine/doctrine2/pull/6580) thanks to @Tobion
- [6613: There is the fail "UNIQUE constraint failed" with a LAZY collection](https://github.com/doctrine/doctrine2/issues/6613) thanks to @Sysaninster
- [6614: `UNIQUE constraint failed` errors when manipulating a `LAZY` collection and calling `toArray()` on it](https://github.com/doctrine/doctrine2/pull/6614) thanks to @Sysaninster
- [6616: #6613 #6614 correct handling of new elements added to an initialized (yet dirty) collection](https://github.com/doctrine/doctrine2/pull/6616) thanks to @Ocramius
Assets 2