Tree still being maintained when entity_hierarchy_disable_writes=1

Issue information

From user: jonathan_hunt

Contribution record

Fork management

Problem/Motivation

A node complete migration was performing glacially even though I'd set entity_hierarchy_disable_writes to 1. It turns out entity_hierarchy_entity_update() was in play, trying to move children between revisions of a node.

Steps to reproduce

Run a revision-aware migration involving destination nodes with an entity hierarchy relationship. Observe entity_hierarchy_entity_update() being invoked, even if tree maintenance is disabled.

Proposed resolution

Add a check in entity_hierarchy_entity_update() to return immediately if `entity_hierarchy_disable_writes` is true.

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information