Remove 'Add Child' Operation When Max Depth = 0

Created on 22 December 2024, 24 days ago

Problem/Motivation

The ‘Add child’ operation is displayed in the taxonomy term actions dropdown, even when a vocabulary’s Max Depth is set to 0.

While the module prevents child term creation through validation, the presence of this operation in the dropdown is misleading, as it suggests the action is allowed when it is not.

This can lead to user confusion and unnecessary interactions, impacting workflow efficiency and clarity.

Proposed Resolution

• Create a TaxonomyTermOperationAlterer service that evaluates the Max Depth setting of a vocabulary and removes the ‘Add child’ operation when the depth is 0.

• Implement hook_entity_operation_alter() to dynamically alter operations and delegate logic to the service.

Feature request
Status

Active

Version

2.1

Component

Code

Created by

🇸🇦Saudi Arabia mesharideb

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