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?

Comments

r_wel’s picture

Priority: Normal » Major

I've worked for days unsuccessfully trying to upgrade from 7.8 to 7.12 Finally decided to goto 7.11. After upgrade, I cannot run update.php due to this dependency error. Searching through site and googling has not given me an answer (at least not that I understand) on how to resolve this.

Unresolved dependency Menu (Version >7.11 required). Menu Block requires this module and version. Currently using Menu version 7.11

pillarsdotnet’s picture

Workaround: Edit your menu_block/menu_block.info file and change or remove the dependency.

pingers’s picture

I see a couple of solutions...
* provide dependency meta data when checking for updates (obtained from info file by packaging script?) to resolve dependency issues in advance (before download)
or
* backup current modules (like drush) and resolve dependencies after download (and revert modules if necessary)

Any other ideas?

catch’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Needs backport to D7
franz’s picture

+1 to providing the metadata. Backing up to rollback later looks like a big effort that can also open a can of worms and a lot of unnecessary slow operations. What if it crashes before being able to rollback? Also, what if the dependency is there because the it causes an WSOD with an older version of Drupal? You get a deadlock there.

xjm’s picture

Issue tags: +Needs tests
chx’s picture

Category: bug » feature
Priority: Major » Normal

Sorry but you should never ever attempt to update a live site without testing on a copy first. Our first documentation team leader, sepeck 5-6 years ago used "Test site, always start with a test site" as his signature. This still stands. You test what works and what doesn't. I do not think this is not a regression in any way, this is new feature.

franz’s picture

Who said "live"? Even in a test site, this is unexpected behavior that wastes time, IMO.

rkjha’s picture

I also believe that it is more a sort of bug than "not a feature". Even when you work on your test site, you don't expect such unexpected behavior.

welly’s picture

Issue summary provided.

ooystein’s picture

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"
ooystein’s picture

Issue summary: View changes

Issue summary updated

ooystein’s picture

Issue summary: View changes

Added STR

ooystein’s picture

Issue summary: View changes

Move STR to "Problem/Motivation" paragraf

star-szr’s picture

Issue summary: View changes

Make STR into a numbered list

camoa’s picture

Just a question out of ignorance, Isn't it easy if the XML file adds attributes for the dependencies? That way you avoid a lot of disk activity in the update. You will have to uncompress the file before update, get the info file, parse it get dependencies. Everytime you run updates.

What if this is done at the "backend" once per every release? and pass into the XML file. Once this is done, vreating a patch will be a little easier, and done before updating anything. Making the module create a kind of cyclic update, publishing only those with dependencies already covered. Or something like that.

I may be talking out of ignorance here.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

catch’s picture

Status: Active » Closed (outdated)

Marking outdated. Automatic updates handles this, and the feature to install modules via URL is in the process of being removed from core.

#3417136: Remove adding an extension via a URL
#3502973: Remove UI and routes for the ability to update modules and themes via update.module and authorize.php

https://www.drupal.org/project/automatic_updates