Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
One can use a profile which lists modules expecting their dependencies to be installed for install but not for testing because testing enables modules without their dependencies. This fails.
Proposed resolution
Patch simpletest to allow pass $enable_dependencies = TRUE
into module_enable
for non-core profiles. Also, make module_enable
enabled required modules first.
Remaining tasks
Answer the query in #10. That is explain why this fix in necessary for the testing system but not for the other two ways of installing Drupal (drush and install.php).
User interface changes
None.
API changes
New property available in tests.
Comment | File | Size | Author |
---|---|---|---|
#4 | 1415198_4.patch | 1.6 KB | chx |
#4 | 1415198_4_d7.patch | 1.56 KB | chx |
#1 | profileNeedsDependencies.patch | 1.9 KB | chx |
#1 | profileNeedsDependencies-d7.patch | 1.86 KB | chx |
profileNeedsDependencies-d7.patch | 1.06 KB | chx | |
Comments
Comment #1
chx CreditAttribution: chx commentedThis, however, meant that required modules now might be pulled in via dependencies and they need to bubble to the top.
Comment #2
chx CreditAttribution: chx commentedNote that there is no test written for this because it would require a whole new profile and that simply doesn't worth it. If you want to test, create a profile:
Comment #3
boombatower CreditAttribution: boombatower commentedSeems like checking for core profiles and defaulting $profileNeedsDependencies to TRUE if not a core profile would be better since most non-core profiles will have things like views and not list out ctools, etc. One less thing people have to worry about.
Comment #3.0
boombatower CreditAttribution: boombatower commentedWrote a purdy issue summary.
Comment #4
chx CreditAttribution: chx commentedComment #5
boombatower CreditAttribution: boombatower commentedLooks fine, I have not tested manually.
Comment #6
catchThis is at least partly the same issue as #1093420: Recursive module dependencies of installation profile are not enabled in DrupalWebTestCase::setUp or #1253774: Dependencies of dependencies are ignored by installation profiles (and by test setUp methods) - would be good to mark the right issues duplicate before committing.
Also:
The comment is not enough to explain why this is necessary - why can it only happen during a test install?
Comment #7
chx CreditAttribution: chx commentedBecause required modules are installed during install :) I do not know what else to say. That's why they are required.
Comment #8
catchWhy does it happen in test installs, and not any other kind of install?
Comment #9
chx CreditAttribution: chx commentedBecause install does this sorting on its own to batch it.
Comment #10
catchDiscussed this briefly with chx in irc, here's a longer explanation of why this needs work:
There are at least three possible ways to install Drupal:
1. install.php
2. Drush
3. child sites for testing.
Nothing in here explains why this is necessary only for the testing system as opposed to the other two.
Then, if it's only necessary for Simpletest, we'd need a really (really really) good reason to not fix that in the testing system as opposed to adding code to module.inc.
Comment #10.0
catchChanged to reflect new patch
Comment #11
mgiffordComment #20
quietone CreditAttribution: quietone as a volunteer commentedTriaging issues in simpletest.module as part of the Bug Smash Initiative to determine if they should be in the Simpletest Project or core.
This looks like it a Phpunit issue, changing component.
Comment #25
quietone CreditAttribution: quietone at PreviousNext commentedThis was a bugsmash daily target today. larowlan and myself looked at the issue.
The points raised in #10 have not been addressed. I have updated the remaining tasks and added related issues. I am changing the status because more information is needed to proceed with this issue.