All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Each release should include sub-headers for the Extension above the types of changes, in order to more easily recognize how an Extension has changed in a release.
## [3.6.1] - 2022-07-26
### Fixed
- Sortable: Fix issue with add+delete position synchronization (#1932)- Restructure the SqlWalkerCompat trait to fix optimized autoloading
- Support for
doctrine/orm3 - Blameable: Added UUID in allowed types list for Blameable fields in Annotation
- Blameable: Allow ascii_string to validTypes (issue #2726)
- Sluggable: Allow ascii_string to validTypes
- IpTraceable: Allow ascii_string to validTypes
- Sluggable: Use
TranslationWalkerhint when looking for similar slugs (getSimilarSlugsmethod) for entities which implementTranslatableinterface and haveuniqueOverTranslations: trueSlug option (#100, #2530)
- Support for defining mapping information from annotations has been deprecated and will be removed in 4.0, use PHP attributes mapping instead.
- Tree: Cascade remove not being triggered on entity children at
MaterializedPath::removeNode(). - Tree: Materialize Path strategy when using autogenerated identifiers.
- SoftDeleteable:
Gedmo\SoftDeleteable\Event\PreSoftDeleteEventArgsandGedmo\SoftDeleteable\Event\PostSoftDeleteEventArgsclasses. - Add support for injecting a
psr/clockimplementation into event adapters that create newDateTimeInterfaceobjects (SoftDeleteable and Timestampable)
- Make doctrine/annotations an optional dependency.
- Remove
@internalannotation fromGedmo\Mapping\Driver\AttributeReader.
- Do not add type-hinted parameters
Gedmo\SoftDeleteable\Event\PreSoftDeleteEventArgsandGedmo\SoftDeleteable\Event\PostSoftDeleteEventArgsclasses topreSoftDeleteandpostSoftDeleteevents. - The
createLifecycleEventArgsInstance()method onGedmo\Mapping\Event\AdapterInterfaceimplementations is deprecated, use your own subclass ofDoctrine\Persistence\Event\LifecycleEventArgsas needed.
- Add conflict against "doctrine/orm" >= 3.
- Add conflict against "doctrine/dbal" => 4.
- Support for Symfony 7
- Tree: Added
@templateand@template-extendsannotations to the Tree repositories
- Dropped support for PHP < 7.4
- Dropped support for Symfony < 5.4
- Dropped support for doctrine/dbal < 3.2
- Calling
Gedmo\Mapping\Event\Adapter\ORM::getObjectManager()andgetObject()on EventArgs that do not implementgetObjectManager()andgetObject()(such as old EventArgs implementinggetEntityManager()andgetEntity()) - Calling
Gedmo\Uploadable\Event\UploadableBaseEventArgs::getEntityManager()andgetEntity(). CallgetObjectManager()andgetObject()instead.
- References: fixed condition in
XMLDriver that did not allow to retrieve from the entity definition themappedByandinversedByfields. - Fix bug collecting metadata for inherited mapped classes
- Tree:
setSibling()andgetSibling()methods in theNodeinterface through the BC@methodannotation - Tree: Support array of fields and directions in the
$sortByFieldand$directionparameters atAbstractTreeRepository::recover() - Loggable: Support for composite identifiers
- Named arguments have precedence over the values passed in the
$dataarray in annotation classes atGedmo\Mapping\Annotation\namespace - Removed conflict against "doctrine/cache" < 1.11, as this library is not used
- Return type from
TranslationProxy::__set()(fromTranslationProxytovoid)
- Tree: Creation of dynamic
Node::$siblingproperty, which is deprecated as of PHP >= 8.2 - Return type from
TranslationProxy::__set()in order to honor its original signature (void)
- Tree: Not implementing
Nodeinterface in classes that are used as nodes - Implementing the
Gedmo\Tool\WrapperInterface::getIdentifier()method without the second argument ($flatten) is deprecated and will be required in version 4.0
- Loggable: Remove unfixable deprecation when extending
LoggableListener - Remove unfixable deprecations when extending repository classes
- Fix error caused by the attempt of "doctrine/annotations" parsing a
@noteannotation
- Tree: [NestedSet] Added "base" property for tree level annotation
- Tree: [NestedSet] Added
$optionsas parameter 2 ingetPathQueryBuilder()to specify whether you want the starting node included or not - Tree: [NestedSet] Added
getPathAsString()method to entity repository - Tree: [NestedSet] Added "treeRootNode" option in
verify()in case you want to verify a single tree in a forest - Tree: [NestedSet] Added
recoverFast()method for where speed is more important than safety and entity manager state - Tree: [NestedSet] Added options to
recover()for sibling order, tree root in a forest, verification skip and auto-flushing - Tree: [NestedSet] Verify and recover wrong levels in nested set
- Tree: Add
Nested::ALLOWED_NODE_POSITIONSconstant in order to expose the available node positions - Support for
doctrine/collections2.0 - Support for
doctrine/event-manager2.0 - Loggable: Add
LogEntryInterfaceinterface in order to be implemented by log entry models
- Sortable: Fix return value check of Comparable interface (#2541)
- Uploadable: Retrieve the correct metadata when uploading entities of different classes (#2071)
- Translatable: Fix property existence check at
TranslatableListener::getTranslatableLocale()
- In order to close the API,
@finaland@internalannotations were added to all non base classes, which means that extending these classes is deprecated and can not be inherited in version 4.0. - Sortable: Accepting a return type other than "integer" from
Comparable::compareTo()is deprecated inSortableListener::postFlush(). This will not be accepted in version 4.0. - Deprecate the annotation reader being allowed to be any object.
In 4.0, a
Doctrine\Common\Annotations\ReaderorGedmo\Mapping\Driver\AttributeReaderinstance will be required. Gedmo\DoctrineExtensions::registerAnnotations()is deprecated and will be removed in 4.0, the method has been no-op'd as all supporteddoctrine/annotationsversions support autoloading- Loggable: Constants
LoggableListener::ACTION_CREATE,LoggableListener::ACTION_UPDATEandLoggableListener::ACTION_REMOVEare deprecated. UseLogEntryInterface::ACTION_CREATE,LogEntryInterface::ACTION_UPDATEandLogEntryInterface::ACTION_REMOVEinstead.
- Bump "doctrine/event-manager" dependency from ^1.0 to ^1.2.
- Tree: TreeRoot without rootIdentifierMethod when calling getNextSiblings (#2518)
- Sortable: Fix duplicated positions when manually updating position on more than one object (#2439)
- Tree: Allow sorting children by a ManyToOne relation (#2492)
- Tree: Fix passing
nulltoabs()function - Timestampable: Use an attribute in Timestampable attribute docs
- Tree: Passing
nullas argument 8 toNested::shiftRangeRL()
- Sluggable: Add support for
DateTimeImmutablefields - Tree: [NestedSet]
childrenQueryBuilder()to allow specifying sort order separately for each field - Tree: [NestedSet] Added option to reorder only direct children in
reorder()method
- Tree: In
ClosureTreeRepository::removeFromTree()andNestedTreeRepository::removeFromTree()when something fails in the transaction, it uses thecodefrom the original exception to construct the\Gedmo\Exception\RuntimeExceptioninstance instead ofnull.
- Sluggable: Cast slug to string before passing it as argument 2 to
preg_match()(#2473) - Sortable: [SortableGroup] Fix sorting date columns in SQLite (#2462).
- PHPDoc of
AbstractMaterializedPath::removeNode()andAbstractMaterializedPath::getChildren() - Retrieving the proper metadata cache from Doctrine when using a CacheWarmer.
- Add support for doctrine/persistence 3
- Removed call to deprecated
ClassMetadataFactory::getCacheDriver()method. - Dropped support for doctrine/mongodb-odm < 2.3.
- Make doctrine/cache an optional dependency.
- Loggable: Fix
appendNumberrenaming for files without extension (#2228)
- Translatable: Add defaultTranslationValue option to allow null or string value (#2167). TranslatableListener can hydrate object properties with null value, but it may cause a Type error for non-nullable getter upon a missing translation.
- Uploadable:
FileInfoInterface::getSize()return type declaration (#2413). - Tree: Setting a new Tree Root when Tree Parent is
null. - Tree: update cache key used by Closure to match Doctrine's one (#2416).
- Tree: persist order does not affect entities on Closure (#2432)
- SoftDeleteable: Support to use annotations as attributes on PHP >= 8.0.
- Blameable: Support to use annotations as attributes on PHP >= 8.0.
- IpTraceable: Support to use annotations as attributes on PHP >= 8.0.
- Sortable: Support to use annotations as attributes on PHP >= 8.0.
- Sluggable: Support to use annotations as attributes on PHP >= 8.0.
- Uploadable: Support to use annotations as attributes on PHP >= 8.0.
- Tree: Support to use annotations as attributes on PHP >= 8.0.
- References: Support to use annotations as attributes on PHP >= 8.0.
- ReferenceIntegrity: Support to use annotations as attributes on PHP >= 8.0.
- SoftDeleteable: Support for custom column types (like Carbon).
- Timestampable: Support for custom column types (like Carbon).
- Translatable: Added an index to
Translationentity to speed up searches usingGedmo\Translatable\Entity\Repository\TranslationRepository::findTranslations()method. Gedmo\Mapping\Event\AdapterInterface::getObject()method.
- Blameable, IpTraceable, Timestampable: Type handling for the tracked field values configured in the origin field.
- Loggable: Using only PHP 8 attributes.
- References: Avoid deprecations using LazyCollection with PHP 8.1
- Tree: Association mapping problems using Closure tree strategy (by manually defining mapping on the closure entity).
- Wrong PHPDoc type declarations.
- Avoid calling deprecated
AbstractClassMetadataFactory::getCacheDriver()method. - Avoid deprecations using
doctrine/mongodb-odm>= 2.2 - Translatable:
Gedmo\Translatable\Document\Repository\TranslationRepository::findObjectByTranslatedField()method accessing a non-existing key.
- Tree: When using Closure tree strategy, it is deprecated not defining the mapping associations of the closure entity.
Gedmo\Tool\Logging\DBAL\QueryAnalizerclass without replacement.- Using YAML mapping is deprecated, you SHOULD migrate to attributes, annotations or XML.
Gedmo\Mapping\Event\AdapterInterface::__call()method.Gedmo\Tool\Wrapper\AbstractWrapper::clear()method.Gedmo\Tool\Wrapper\WrapperInterface::populate()method.
- In order to use a custom cache for storing configuration of an extension, the user has to call
setCacheItemPool()on the extension listener passing an instance ofPsr\Cache\CacheItemPoolInterface.
- PHP 8 Attributes support for Doctrine MongoDB to document & traits.
- Support for doctrine/dbal >=3.2.
- Timestampable: Support to use annotations as attributes on PHP >= 8.0.
- Loggable: Support to use annotations as attributes on PHP >= 8.0.
- Translatable: Dropped support for other values than "true", "false", "1" and "0" in the
fallbackattribute of thetranslatableelement in the XML mapping. - Tree: Dropped support for other values than "true", "false", "1" and "0" in the
activate-lockingattribute of thetreeelement in the XML mapping. - Tree: Dropped support for other values than "true", "false", "1" and "0" in the
append_id,starts_with_separatorandends_with_separatorattributes of thetree-pathelement in the XML mapping. - Dropped support for doctrine/dbal < 2.13.1.
- The third argument of
Gedmo\SoftDeleteable\Query\TreeWalker\Exec\MultiTableDeleteExecutor::__construct()requires aDoctrine\ORM\Mapping\ClassMetadatainstance.
- Translatable: Using ORM/ODM attribute mapping and translatable annotations.
- Tree: Missing support for
tree-path-hashfields in XML mapping. - Tree: Check for affected rows at
ClosureTreeRepository::cleanUpClosure()andClosure::updateNode(). Gedmo\Mapping\Driver\Xml::_loadMappingFile()behavior in scenarios wherelibxml_disable_entity_loader(true)was previously called.- Loggable: Missing support for
versionedfields atattribute-overridein XML mapping.
- Support to use Translatable annotations as attributes on PHP >= 8.0.
Gedmo\Mapping\Driver\File::$_pathsproperty andGedmo\Mapping\Driver\File::setPaths()method are deprecated and will be removed in version 4.0, as they are not used.
- Value passed in the
--configoption tofix-csComposer script. - Return value for
replaceRelative()andreplaceInverseRelative()atGedmo\Sluggable\Mapping\Event\Adapter\ODMif the query result does not implementDoctrine\ODM\MongoDB\Iterator\Iterator. - Restored compatibility with doctrine/orm >= 2.10.2 (#2272).
Since doctrine/orm 2.10,
Doctrine\ORM\UnitOfWorkrelies on SPL object IDs instead of hashes, thus we need to adapt our codebase in order to be compatible with this change. AsDoctrine\ODM\MongoDB\UnitOfWorkfrom doctrine/mongodb-odm still usesspl_object_hash(), allspl_object_hash()calls were replaced byspl_object_id()to make it work with both ORM and ODM managers.
- PHP 8 Attributes for Doctrine ORM to entities & traits (#2251)
- Removed legacy checks targeting older versions of PHP (#2201)
- Added missing XSD definitions (#2244)
- Replaced undefined constants from
Doctrine\DBAL\Types\TypeatGedmo\Translatable\Mapping\Event\Adapter\ORM::foreignKey()(#2250) - Add conflict against "doctrine/orm" >=2.10 in order to guarantee the schema extension (see doctrine/orm#8852) (#2255)
- Allow installing doctrine/cache 2.0 (thanks @alcaeus!)
- Make doctrine/cache a dev dependency
- Use path_separator when removing children (#2217)
- Add hacky measure to resolve incompatibility with DoctrineBundle 2.3 #2211
- Add PHP 8 compatibility to
composer.json, resolving minor function parameter deprecations #2194
- Ignore; tag & version mismatch
- Ignore; wrong branch published
- Minimum PHP version requirement of 7.2
- Source files moved from
/lib/Gedmoto/src - Added compatibility for
doctrine/common3.0 anddoctrine/persistence2.0 - All string column type annotations changed to 191 character length (#1941)
- Removed support for
\Zend_datedate format #2163 - Renamed
Zend FrameworktoLaminas#2163
Changes below marked
- Requires the
ext-mongodbPHP extension. Usage ofext-mongois deprecated and will be removed in the next major version. - Minimum Doctrine MongoDB ODM requirement of 2.0
- Usages of
\MongoDatereplaced withMongoDB\BSON\UTCDateTime
- Removed
nullparameter fromDoctrine\Common\Cache\Cache::save()calls (#1996)
- The value of path source property is cast to string type for Materialized Path Tree strategy (#2061)
⚠️ Generate different Date values based on column type (#2115)