auto_entitylabel_entity_insert breaks hook_entity_insert

Created on 19 June 2023, over 1 year ago
Updated 24 August 2024, 3 months ago

Problem/Motivation

The auto_entitylabel_entity_insert function saves the entity and that is not allowed according to hook_entity_insert documentation https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...

It breaks the hook_entity_insert and hook_entity_updates hooks for others as they now both fire in reverse order for other modules.

This hook runs once the entity has been stored. Note that hook implementations may not alter the stored entity data.

Steps to reproduce

Add hook_entity_insert and hook_entity_updates to your module and make sure you use auto_entity_label on this entity.

On entity insert hook_entity_insert and hook_entity_updates will both fire in reverse order which is wrong

Proposed resolution

Remove the save from hook_entity_insert

Remaining tasks

Remove the save from hook_entity_insert

User interface changes

API changes

Remove the save from hook_entity_insert

Data model changes

🐛 Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

🇪🇸Spain joristhedrupalist

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024