Update manager calls batch_process() directly from a form submit handler, preventing later submit handlers from running

Created on 17 April 2011, about 14 years ago
Updated 14 May 2025, 19 days ago

On certain server setups, when installing or updating a module the Update Manager code will force the associated batch to be processed immediately from within a form submit handler. This means that any submit handlers that run afterwards will never run, since processing a batch calls drupal_goto().

The standard way to handle this situation is to let the form API initiate the batch process for you, since it automatically makes sure to process the batch only after all submit handlers have run. There's never really a good reason to call batch_process() yourself from within a form submit handler.

The attached patch makes the Update Manager use that method.

πŸ› Bug report
Status

Closed: won't fix

Version

11.0 πŸ”₯

Component

update.module

Created by

πŸ‡ΊπŸ‡ΈUnited States David_Rothstein

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

Production build 0.71.5 2024