Update.module should not update modules that require a higher version of Drupal core

Created on 19 March 2012, about 13 years ago
Updated 14 February 2025, 3 months ago

Problem/Motivation

On updating a module to a version that has a dependency on an earlier version of Drupal core, update.php cannot be run.

Steps to reproduce

  1. Install Drupal 7.10.
  2. Go to '/admin/modules/install' and install module Menu Block v. 7.x-2.2 (http://ftp.drupal.org/files/projects/menu_block-7.x-2.2.tar.gz).
  3. Enable Menu Block module in '/admin/modules'.
  4. Check for updates here '/admin/reports/updates/check?destination=admin/modules/update'.
  5. Select the update for Menu Block in '/admin/modules/update' and download and upgrade it to version 7.x-2.3.
  6. Go to '/update.php'. The update will not run but returns this error message:
    "Error Unresolved dependency Menu (Version >7.11 required)
    Menu Block requires this module and version. Currently using Menu version 7.10"

Proposed resolution

It has been suggested that the update module detects the missing dependency and rolls back the update. Alternative suggestions to resolve this issue include providing dependency metadata in the module obtained from the module's .info file or backing up the currently installed module before updating and reverting if necessary.

Remaining tasks

To develop a method of checking dependencies prior to upgrading modules.

User interface changes

None

API changes

None

Original report by mstrelan

On a Drupal 7.7 site I've updated Menu Block from 7.x-2.0-beta4 to 7.x-2.3 and now cannot run update.php because Menu Block requires Drupal 7.11 or higher.

Is there a way update.module can detect this missing dependency earlier and rollback the update to the module?

Feature request
Status

Closed: outdated

Version

11.0 🔥

Component

update.module

Created by

🇦🇺Australia mstrelan

Live updates comments and jobs are added and updated live.
  • 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.

  • 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.

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