Preview causes unnecessary build for nodes that are in menu

Created on 7 February 2024, 5 months ago

Problem/Motivation

I have a decoupled project that is using Simple Decoupled Preview module . When previewing content that is in menu, entity with type preview_log_entity gets passed to build_hooks and that's fine, in /admin/config/build_hooks/settings I have defined that it shouldn't cause build. Problem is that entity with type 'menu_link_content' is also passed to build_hooks causing an unnecessary build. Issue is related to https://www.drupal.org/project/build_hooks/issues/3345885 Entity references can result in multiple builds Needs work and that patch would work if 'preview_log_entity' would be passed before 'menu_link_content' entity but it's not.

Steps to reproduce

Have decoupled project with simple_decoupled_preview and build_hooks modules.
Configure the frontend(s) deployment strategy to be: "When content is updated".
Add a node to menu.
Go preview that node and notice an unnecessary build.

Proposed resolution

By checking in DeployLogger.php if entity type is 'menu_link_content' and in that case checking if the entity's 'changed' value minus current time is 0. If it is, it means it has been changed and build should be run if change in menu items is in the entity types that should cause a build.

🐛 Bug report
Status

Active

Version

3.3

Component

Code

Created by

🇫🇮Finland akseli.miettinen

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

Comments & Activities

Production build 0.69.0 2024