Install

Works with Drupal: ^10.5 || ^11.2 || ^12

Using dev releases is not recommended, except for testing.

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 93.44 KB
MD5: 67d83f94c2315915cb38ed2ba74d58ee
SHA-1: 3f4a983302be14340344c4717e825eca416c88d4
SHA-256: 0ecab6cd4c327ba6eb250b14c3542cf89db69aae2e0f92b49db013a2ce6daac0
Download zip 205.31 KB
MD5: dce73b015dcd5b95b648917153dce23a
SHA-1: 8e2e4ba6ebd2a9bf164cd1aff07170bc8a74aa9d
SHA-256: 23e878026f1baeafcf15bcf751be67a288c84114cdfd646f2601476d04570058

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: 11 Aug 2026 at 21:07 UTC

Other releases