Update domain_id when field_domain_source is changed

Created on 28 August 2024, 3 months ago
Updated 14 September 2024, 2 months ago

Problem/Motivation

When we update a node's Domain Source field, the domain_id column in the path_alias table is not updated.

Steps to reproduce

Create a new node with field_domain_source value as Domain A.
Check the path_alias table - The domain_id column contains Domain A.
Edit the same node and change the field_domain_source value to Domain B.
Check the path_alias table - The domain_id column is not updated with Domain B.

Proposed resolution

I guess we have to use the existing hook_entity_presave to add a condition to check for Node entities being saved.
Get the right Domain ID from the getDomainIdFromEntity() function and compare it with the existing Domain ID.
If they are different, update the path_alias

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India chiragkparikh

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