hook_cloned_node_alter fires every time the cloned node page loads

Created on 25 January 2023, about 2 years ago
Updated 26 January 2023, about 2 years ago

Thanks for the module!

Problem/Motivation

When using hook_cloned_node_alter(), the function fires every time the cloned node page refreshes. (clone/ID/quick_clone)

This is a problem say if you want to populate a referenced entity with some values, and need to edit the values, it runs the whole hook again on updating the inline entity form, or refreshing the page.

Steps to reproduce

implement the hook, and use xdebug.

Proposed resolution

Shouldn't the hook only fire when building the cloned node the first time? Is there a was to make it only fire on the first build of the cloned node?

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024