Problem/Motivation
drupal_check_profile() and drupal_verify_profile() are responsible for ensuring the presence of all the modules specified by the installation profile, and verifying their requirements. However, during a config-based install, the profile isn't as relevant; it's more important to ensure that the extensions listed in the core.extension config object are all present. But neither function currently does that. As long as the profile's modules are all present and their requirements check out, installation proceeds.
Proposed resolution
drupal_check_profile() and drupal_verify_profile() need to detect if a config-based install is in progress, and if so, they should be using core.extension to get the list of modules to locate and verify.
Remaining tasks
Write a fail patch, then a fix patch, review it, and commit it.
User interface changes
None.
API changes
TBD, but likely none.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | 3005959-21.patch | 8.22 KB | alexpott |
| #21 | 19-21-interdiff.txt | 743 bytes | alexpott |
| #19 | 3005959-19.patch | 8.16 KB | alexpott |
| #19 | 15-19-interdiff.txt | 1.36 KB | alexpott |
| #15 | 3005959-15.patch | 9.71 KB | alexpott |
Issue fork drupal-3005959
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
alexpottThanks for opening this one.
Comment #4
alexpottHere's a fix. Need to work out how to test this. Feels a bit tricky because it only happens when a module that is in the install list for a profile is not around when installing that profile from configuration.
Comment #5
alexpottHere's a test building on the testing of
drupal_verify_profilein HEAD.Comment #6
alexpottStill need to handle - drupal_check_profile()
Comment #10
alexpottStill need to handle
drupal_check_profile()but here's a fixed patch and a test-only patch to prove we've fixed the bug when callingdrupal_verify_profile()Comment #12
alexpottHere's an update to
drupal_check_profile()plus test coverage for the changes.Comment #14
daniel.bosenI successfully tested the following situations, that we had problems with, when installing from config:
a) Removing a manually disabled module, that was required by the profile.
=> Importing this configuration works now without problems
b) Removing a manually required and enabled module, that the profile did not know about.
=> This correctly fails now.
So, functionally this works perfectly!
Just a few nits I found in the patch:
Missing full-stop
I guess the "ff" sould be an "if"?
Another missing full-stop
Comment #15
alexpott@daniel.bosen thanks for the review.
Fixed everything in the attached patch.
Comment #16
daniel.bosenLooks good to me!
Comment #17
phenaproximaThis looks like it might be noise from a different issue...??
Comment #18
daniel.bosenTrue story, just took a look at the interdiff...
Comment #19
alexpottThanks @phenaproxima.
Comment #20
phenaproximaThese comments are not particularly clear. What does "there are errors" mean? Why are there errors? Maybe something like "prepareEnvironment() sets up an erroneous configuration on purpose, so this method must be bypassed" would make more sense.
But, that said, this ain't my issue, so I'm bowing out now. :)
Comment #21
alexpottSure n.p.
Comment #22
phenaproximaRestoring RTBC! I haven't deeply reviewed this patch, so I trust @daniel.bosen's judgment :)