Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I want add some additional submit function to the form, I tried to use the form id in views, but without success.
Comment | File | Size | Author |
---|---|---|---|
#4 | editablefields_hook_form_alter-1938052-4.patch | 960 bytes | reevo |
#3 | edtablefields_hook_form_alter-1938052-3.patch | 1.27 KB | vaibhav571 |
Comments
Comment #1
geraldito CreditAttribution: geraldito commentedYou just have to look for the form name and do something like:
Comment #2
chertzogWiIth the latest dev:
Around Line 472:
Change:
To:
Comment #3
vaibhav571 CreditAttribution: vaibhav571 commentedYou can use this patch to alter the forms using hook_editablefields_form_alter to alter the forms which will be rendered while in the editing mode
Comment #4
reevo CreditAttribution: reevo commentedI found the patch in #3 resulted in editable fields failing to render unless hook_editablefields_form_alter was invoked. The attached patch achieves the desired outcome by using drupal_alter to enable alteration of both the $form and $form_state.
Comment #5
joelpittetSeems to moved to a feature request
Comment #6
Collins405 CreditAttribution: Collins405 commentedEven with patch 3, any hook i use simply gets ignored by the editable field.
I can see the results in devel dpm() but nothing happens in the actual field.
Comment #7
joelpittetWhy can't this be done as a hook_form_alter? Sorry if you described this already
Comment #8
reevo CreditAttribution: reevo commented@joelpittet I distinctly remember being unable to achieve any alterations to editable fields, which is why I found this issue in the first place, however this no longer appears to be the case.
So, I'm happy to confirm that I'm now able to alter editable fields using the standard hook_form_alter. Please note, though, that I'm not rendering editable fields using Views as others in this thread appear to be.
Comment #9
joelpittetThanks for the confirmation @reevo
Comment #10
mducharme CreditAttribution: mducharme as a volunteer commentedSince hook_form_alter can be used now, the original issue is now outdated. Marking as such.