Skip to content

Replace taxonomy_get_tree in path_entity_update #6950

@bennybobw

Description

@bennybobw

Description of the bug

The issue is that path_entity update (of hook_entity_update) calls taxonomy_get_tree. It does so with a parent term. However, even with a parent term defined on the first run that function will attempt to cache the whole taxonomy tree. This is problematic for trees with a lot of terms in them (we've got 100,000+ in this particular taxonomy).

Steps To Reproduce

  1. Make a taxonomy with a LOT of terms, so many it will overwhelm your
  2. Attempt to save one of the terms in that vocabulary

Actual behavior

PHP will run out of memory!

Expected behavior

I expect it to save properly.

Additional information

I did this on a site with 256M of memory for the php process, php 8.2 and a vocabulary of 100,000+ terms. It was calling entity_load_multiple on all 100,000

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions