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.
Worked fine here. Just needed a little customization to be more close to my needs (cancel button appearing only in editing state) but I think the patch you've posted will help a lot the major use cases.
Romaingar's answer proved very helpful. Two notes about it though. The variable $display is not set anywhere in the provided code. It appears to be a reference to the $display argument in editablefields_form() which is then hooked by this function. I accessed this variable in my hook_form_alter() function by setting $display = $form_state['build_info']['args'][5] as this appears to hold the values sent to the originating function. Secondly, there is no #value attribute set in the $form['actions']['cancel'] array so the new button appeared as a blank button or as just a sliver of a button depending on the theme I was using.
Comments
Comment #1
kingdee40 CreditAttribution: kingdee40 commentedAdded cancel button via javascript.
Comment #2
rosemberg CreditAttribution: rosemberg commentedkingdee40, thank you so much!
Worked fine here. Just needed a little customization to be more close to my needs (cancel button appearing only in editing state) but I think the patch you've posted will help a lot the major use cases.
Comment #2.0
rosemberg CreditAttribution: rosemberg commentedtypo
Comment #3
romaingar CreditAttribution: romaingar commentedHello just in case you would like to perform a cancel button without reload the page as the solution #1
Comment #4
sistro CreditAttribution: sistro commentedVery useful... but the patch fails with latest dev version.
Romaingar solution is for a custom module, right?
Comment #5
Gunfigter100 CreditAttribution: Gunfigter100 commentedRomaingar's answer proved very helpful. Two notes about it though. The variable $display is not set anywhere in the provided code. It appears to be a reference to the $display argument in editablefields_form() which is then hooked by this function. I accessed this variable in my hook_form_alter() function by setting $display = $form_state['build_info']['args'][5] as this appears to hold the values sent to the originating function. Secondly, there is no #value attribute set in the $form['actions']['cancel'] array so the new button appeared as a blank button or as just a sliver of a button depending on the theme I was using.