Problem/Motivation

An oddity I just ran into with D7:

  • New installation of Drupal 7.7 core + many contrib modules
  • Rules (7.x-2.0-rc1) was downloaded.
  • Entities API was not downloaded.
  • Rules was listed as a dependency on the install profile, Entities API was not. Note: Entities API is a dependency for Rules.
  • The install ran fine, it installed all of the other modules & no errors showed up, except that once it tried to bring up install.php?op=finished the Rules module gave an error that one of the Entities API classes could not be loaded, i.e. it wanted the Entities API module but it had not checked for its existence.

Some related issues:

Related search terms:

  • Recursive dependencies
  • Nested dependencies

Proposed resolution

The patch proposed in #9, although it is sort of hacky.

Remaining tasks

Reroll the proposed patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Issue tags: +Needs backport to D7

Fixing tag.

Xen’s picture

subscribe

Pancho’s picture

Note that Panopoly Core tries to fill this gap:
panopoly_core_install_load_profile() at least includes second level dependencies (nominal, without required versions).
A core patch should probably be more complete going deeper and respecting required versions.

hefox’s picture

I played with this a bit in 7 due to the simpletest issue #1093420: Recursive module dependencies of installation profile are not enabled in DrupalWebTestCase::setUp. The code for rearranging based on dependency is there in module_enable, so it'd be nice to module_enable and install_profile_info shared a helper function. However, module_enable exists out if a dependency is missing from filesystem and doesn't care about enabled modules, so that will need to be handled. Also, required modules need to be first still as they are never listed as dependency but items do depend on them. (Currently if you give module_enable a list that includes required modules and tell it to include dependencies, it rearranges the required to be after non-required sometimes)

hefox’s picture

Status: Active » Needs review
FileSize
5.63 KB

First stab, creates a function for both module_enable and install_profile_info to use

Status: Needs review » Needs work

The last submitted patch, 1253774_module_order_by_dependencies-5.patch, failed testing.

hefox’s picture

Status: Needs work » Needs review
FileSize
5.21 KB

During install, cannot use system_rebuild_module_data unlike module_enable, however can use some of it's internal functions to get the same data.. hacky, and reallly don't think that's the correct way to tell it's install time.

  global $install_state;
  if (!empty($install_state)) {
    $module_data = _system_rebuild_module_data();
    foreach (array_keys($module_data) as $module) {
      $module_data[$module]->status = 0;
    }
    $module_data = drupal_container()->get('module_handler')->buildModuleDependencies(_system_rebuild_module_data());
  }
  else {
    $module_data = system_rebuild_module_data();
  }

Status: Needs review » Needs work

The last submitted patch, 1253774_module_order_by_dependencies-7.patch, failed testing.

hefox’s picture

Status: Needs work » Needs review
FileSize
5.12 KB

I guess I could remove that debugging trigger_error....

joachim’s picture

Title: Dependencies of dependencies are ignored by installation profile. » Dependencies of dependencies are ignored by module_enable()
Issue summary: View changes
Issue tags: +DrupalWTF, +DX (Developer Experience), +Needs issue summary update

Changing the title, as this doesn't just affect install profiles.

If you write a test, and give setUp() a list of module, you'd think that ALL the dependencies get enabled, no? Wrong!

Needs a summary update, but I have crashing tests to fix :(

jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
areke’s picture

Issue summary: View changes
areke’s picture

ankitgarg’s picture

Status: Needs work » Needs review
FileSize
1.14 KB

Rerolled

Status: Needs review » Needs work

The last submitted patch, 14: 1253774_module_order_by_dependencies-14.patch, failed testing.

ravi.khetri’s picture

Status: Needs work » Needs review
FileSize
1.14 KB

Rerolled.

Status: Needs review » Needs work

The last submitted patch, 16: 1253774_16.patch, failed testing.

Status: Needs work » Needs review

jhedstrom queued 16: 1253774_16.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 16: 1253774_16.patch, failed testing.

Sivaji_Ganesh_Jojodae’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
jhedstrom’s picture

Status: Needs review » Needs work

The patch in #16 is throwing fatal errors.

vadym.kononenko’s picture

I've found simple solution to enable even newly added dependencies to already enabled modules. Verified on D7.

We need to:
1. Remove module removal condition to its dependencies could be processed.
2. After dependencies verification loop create another loop and put those removal code there. In this case we avoid dependency loop for already enabled modules.

Just see to my patch for D7 and re-roll it to D8.

David_Rothstein’s picture

Title: Dependencies of dependencies are ignored by module_enable() » Dependencies of dependencies are ignored by installation profiles (and by test setUp methods)
Related issues: +#2498317: Verify dependencies of the dependencies of installation profile.

Marked #2498317: Verify dependencies of the dependencies of installation profile. as a duplicate.

I'm changing the issue title here too - module_enable() itself works fine; the extra issue identified in #10 is for tests only (see also #1093420: Recursive module dependencies of installation profile are not enabled in DrupalWebTestCase::setUp which is postponed on this one - and says that that part is a Drupal 7 issue only, which it may be).

lachezar.valchev’s picture

Hi,

Forgot the file. Added it in the comment below.

Regards,
Lachezar

lachezar.valchev’s picture

Hi,

I am adding my proposal for patch related to #2498317: Verify dependencies of the dependencies of installation profile. that will allow check of the dependencies not only on the profile, but also the dependencies of the profile dependencies.

Thus, if there are missing modules they will be detected as early as possible.

The patch is for D7.

Regards,
Lachezar

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.

Kingdutch’s picture

Assigned: Unassigned » Kingdutch
Issue tags: +Needs reroll

Tests indicate that #9 had a working patch. From what I can see, the rerolls were faulty and removed (the method is gone from the patch and I can't find it in the Drupal core codebase) at least the module_order_by_dependencies method which is what's now causing the errors.

I'm hiding the two (in my eyes) faulty rerolls and marking this for a new reroll which I'll attempt to do this week.

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.

vacho’s picture

If this issues is for backport from D8 to D7

Why?
Version: 8.6.x-dev

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.

luke.stewart’s picture

Looking at this:

This issue dates back to D7 and is flagged with needs backport - but in this stage of D7 lifecycle I think this can be removed as this bug relates to new installs - and one would hope new installs of D7 are extremely rare at this point!

1093420 is an attempt to address the impacts of this bug when testing based on install profiles this seems to indicate this is still a problem - but only in D7 - there is no evidence for D8+

Reading back over the issue

I'm flagging this as needs manual testing. As I don't see any evidence suggesting that this is an issue in D9/10/11. If it is we definitely should address. But the implementation has changed somewhat and based on the comments of the method in D11 branch I'm not convinced this is still a problem.

Kingdutch’s picture

Assigned: Kingdutch » Unassigned

I did not get to it in the fatal week of 2018, nor in any week since: unassigning.

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.