Dynamic method naming support within the same plugin instance

Created on 21 September 2024, 7 months ago

Problem/Motivation

At the moment the only way to have multiple forms altered in the same plugin is to have some sort of logic that maps a specific form ID to a specific method. Or to have a plugin per base form, which not always convenient.

Proposed resolution

Provide a trait for dynamic form ID to method mapping.

Remaining tasks

Review, test, merge.

User interface changes

None

API changes

Adds a trait which does not alter default API unless the trait is used.

✨ Feature request
Status

Active

Version

1.7

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States euk

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

Merge Requests

Comments & Activities

  • Issue created by @euk
  • πŸ‡ΊπŸ‡ΈUnited States euk

    The DynamicMethodResolutionTrait trait performs mapping of form IDs to internal methods. Internal methods naming should be in the form of "formAlterFormId". E.g. for a form with ID "node_form" the matching method would need to be called "formAlterNodeForm". Specific form ID has a precedence over the base form ID, thus still allowing for targeted form alters. If there is a need to use a generic form alter callback that would cover all the form IDs supported by plugin the 'genericFormAlter' can be used.

  • πŸ‡ΊπŸ‡ΈUnited States euk
Production build 0.71.5 2024