Install

Works with Drupal: ^10.5 || ^11.2

Using dev releases is not recommended, except for testing.

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 90.03 KB
MD5: f0db4b02600980d41fec230319dc274b
SHA-1: bf7324f9bd9a279b182130e5da31fa5cb30a6765
SHA-256: 9b4107c22f137c94f3c093befc1134e592f92462409574310f24e663093b8a13
Download zip 194 KB
MD5: edd35ce1fab90c55e203ad2af3503135
SHA-1: 4c9fb3a139103b20335f5e0067e2a3b3cf0d6f1e
SHA-256: c72d55ada7f83e8ddbef4a3372197705d53aea9d1cb0cd8c126c02a6cd4778b4

Release notes

⚠️ This is a significant rewrite of the module to make use of newer database engine features

High level changes

Breaking changes

There are several breakages between the 3.x/4.x and the 5.x branch.

If you're not using the views integration and not using the PHP APIs to traverse the tree in custom code, there should be no changes required.

If you are using the PHP APIs or views integration - the following breaking changes exist:

PHP APIs removed

The following services/PHP APIs are removed

  • \Drupal\entity_hierarchy\Storage\EntityTreeNodeMapperInterface - instead use the query builder factory.
    $queryBuilder = \Drupal::service('entity_hierarchy.query_builder_factory')->get($fieldName, $entity->getEntityTypeId());
        $childEntities = $queryBuilder->findChildren($entity)
          ->filter(RecordCollectionCallable::viewLabelAccessFilter(...));
    
  • \Drupal\entity_hierarchy\Storage\NestedSetNodeKeyFactory - there is no replacement, work directly with a Drupal entity and the query factory
  • \Drupal\entity_hierarchy\Storage\NestedSetStorage and \Drupal\entity_hierarchy\Storage\NestedSetStorageFactory - work with the query builder factory (\Drupal\entity_hierarchy\Storage\QueryBuilderFactory instead
  • We no longer use the previousnext/nestedset library, so e.g. value objects like \PNX\NestedSet\Node and \PNX\NestedSet\NodeKey no longer exist

Views changes

The following views changes have been made:

  • The 'Root of hierarchy' relationship has been removed - it may be re-added before a stable release
  • The child of/parent of/sibling of arguments that use the revision ID have been removed, versions that support entity ID still exist
  • Any views fields/sorts/arguments that referenced the old nested_set tables have been replaced with pseudo fields that use the field-data or entity base table. You should check each of your views and find any that have 'broken/missing handler'. Each of these views will require manually editing to use the new field from the base/field tables.
Created by: larowlan
Created on: 3 Jan 2024 at 01:57 UTC
Last updated: 22 Jan 2026 at 01:54 UTC

Other releases