The proposed way to provide a block with a configuration form is hook_block_configure. The problem is that you cannot use AJAX in that form because you do not have $form_state at your disposal. The way to do AJAX-enable a block configuration form in D7 is hook_form_alter().
This simple patch simply passes $form_state to hook_block_configure(), so that you can provide AJAX-enabled forms right there in hook_block_configure(). You can, of course, still use hook_form_alter().

Comments

tstoeckler’s picture

Assigned: Unassigned » tstoeckler

Assigning to me

Status: Needs review » Needs work

The last submitted patch, block_ajax_forms.patch, failed testing.

tstoeckler’s picture

Status: Needs work » Closed (duplicate)
DHL’s picture

I know this post is about D8.
But how to use hook_form_alter() to make Ajax effect in hook_block_configure in D7?