Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When you attempt to execute an install profile which refers to a module that wasn't found, you get a whole slew of errors:
Warning: array_diff() [function.array-diff]: Argument #1 is not an array in /Applications/MAMP/htdocs/head/includes/install.inc on line 306
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Applications/MAMP/htdocs/head/includes/install.inc:306) in /Applications/MAMP/htdocs/head/includes/bootstrap.inc on line 717
Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/head/includes/install.inc:306) in /Applications/MAMP/htdocs/head/includes/bootstrap.inc on line 395
Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/head/includes/install.inc:306) in /Applications/MAMP/htdocs/head/includes/bootstrap.inc on line 396
Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/head/includes/install.inc:306) in /Applications/MAMP/htdocs/head/includes/bootstrap.inc on line 397
Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/head/includes/install.inc:306) in /Applications/MAMP/htdocs/head/includes/bootstrap.inc on line 398
Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/head/includes/install.inc:306) in /Applications/MAMP/htdocs/head/includes/bootstrap.inc on line 399
The installer should check for the existence of all modules in the list prior to executing any install hooks, and inform the user of which modules are missing so they can remedy the problem.
Comment | File | Size | Author |
---|---|---|---|
#9 | check_required_modules_0_0.patch | 1.42 KB | webchick |
#7 | check_required_modules_0.patch | 1.39 KB | webchick |
#3 | check_required_modules.patch | 1.39 KB | webchick |
Comments
Comment #1
webchickWeird. I see that there's a drupal_verify_profile function that already should be doing this but isn't getting called for some reason.
Comment #2
webchickOk. So it is getting called, we're just not doing anything about it:
I tried throwing the rest of the function in an if ($modules) thing but I'm not sure what to do in the "else" case. Any ideas?
Comment #3
webchickOk, maybe something like this.
I'm marking this critical because this seems like a major bug in the install system. The installer should not continue if required modules are not found, and the end user should definitely never be exposed to huge scary errors like that.
Comment #4
Rok Žlender CreditAttribution: Rok Žlender commentedPatch works as promised. If module is not present installer outputs which module and exits without installing drupal and wihtout any "scary" messages.
I am wondering why are there so many install_*_error functions couldnt we join them all in one instal_error($title, $body) function. The only reason I can think off are comments. Now every error function is clearly commented if there will be only one maybe it would lose clarity. Otherwise they all have exact same structure.
I have a patch for this ready but didnt want to upload it if this is a bad idea.
Comment #5
chx CreditAttribution: chx commentedI am marking this RTBC and Rok, please submit another issue, looks promising.
Comment #6
drumm<ul><li>One or more required modules is missing.</li><li>Please check the error messages and try again.</li></ul>
THis doesn't make much sense as a list.
Comment #7
webchickSure, makes sense.
This patch places the message in paragraph tags, and also makes "try again" a link back to the same page; it's not intuitive that you would refresh the page to try again.
Comment #8
Dries CreditAttribution: Dries commented"One or more required modules is missing." Should be "are"?
Also, are the "error messages" going to provide useful information? What do they look like? (I'm not saying we should change things, just being curious.)
Comment #9
webchickFor some reason I thought you treated "one or more" as singular, but in Googling there seem to be more instances of using it as plural, so changed it. :)
Also, yes, the error messages (set as 'error' drupal_set_message()s) say:
"The blah module is required but was not found. Please move it into the modules subdirectory."
Tentatively setting this back to RTBC again.
Comment #10
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD.
Comment #11
(not verified) CreditAttribution: commented