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.

Files: 
CommentFileSizeAuthor
#25 drupal_core-add_modules_dependencies_D7-1253774-23.patch3.54 KBlachezar.valchev
#22 drupal-core--add_modules_dependencies-D7--2.patch1.16 KBvadym.kononenko
#16 1253774_16.patch1.14 KBravi.khetri
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Drupal installation failed.
[ View ]
#14 1253774_module_order_by_dependencies-14.patch1.14 KBankitgarg
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Drupal installation failed.
[ View ]
#9 1253774_module_order_by_dependencies-9.patch5.12 KBhefox
PASSED: [[SimpleTest]]: [MySQL] 55,416 pass(es).
[ View ]

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
StatusFileSize
new5.63 KB
FAILED: [[SimpleTest]]: [MySQL] 9,905 pass(es), 607 fail(s), and 6,871 exception(s).
[ View ]

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
StatusFileSize
new5.21 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]

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.

<?php
 
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
StatusFileSize
new5.12 KB
PASSED: [[SimpleTest]]: [MySQL] 55,416 pass(es).
[ View ]

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
StatusFileSize
new1.14 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Drupal installation failed.
[ View ]

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
StatusFileSize
new1.14 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Drupal installation failed.
[ View ]

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@knackforge.com’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