Put the hook invocation in the form builder into a separate method

Created on 9 March 2017, about 8 years ago
Updated 21 January 2023, over 2 years ago

Problem/Motivation

When decorating the form builder or extending from it there might be the need for e.g. turn off the hook invocation, however this is not possible as the hook invocation is part of the FormBuilder::prepareForm method. Currently I need this in the autosave_form module in order to stop the hook execution on autosaving the user input only, as it is unnecessary and might be expensive.

Proposed resolution

Simply create a new protected method invokeHooks - protected or public is the question?

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Postponed: needs info

Version

10.1 ✨

Component
FormΒ  β†’

Last updated about 13 hours ago

Created by

πŸ‡©πŸ‡ͺGermany hchonov πŸ‡ͺπŸ‡ΊπŸ‡©πŸ‡ͺπŸ‡§πŸ‡¬

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    Wonder if this is still an issue in D10?

    $this->invokeHooks($form_id, $form, $form_state); has been moved.

    Know I use the autosave_form and we haven't had any issues so it seems to be functional on that side?

  • Status changed to Closed: outdated about 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    I believe this one can be closed as the code has evolved. If still a valid task please reopen.

    Am saving credit for @hchonov for the initial work

Production build 0.71.5 2024