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.
Incorrect values inside of $install_state
global variable could lead to fatal errors. For example, execution of drush si standart -y
will fails with a fatal error, because the standart
- is not valid name of installation profiles.
Full stack trace:
BR0kEN@Macintosh:/var/www/drupal/drupal8 (8.3.x) $ drush si standart -y
You are about to DROP all tables in your 'drupal8' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option. [ok]
The following module is missing from the file system: standart bootstrap.inc:235 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302 [warning]
The following module is missing from the file system: standart bootstrap.inc:235 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302 [warning]
The following module is missing from the file system: standart bootstrap.inc:235 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302 [warning]
The following module is missing from the file system: standart bootstrap.inc:235 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302 [warning]
The following module is missing from the file system: standart bootstrap.inc:235 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302 [warning]
The following module is missing from the file system: standart bootstrap.inc:235 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302 [warning]
The following module is missing from the file system: standart bootstrap.inc:235 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302 [warning]
The following module is missing from the file system: standart bootstrap.inc:235 [warning]
strpos(): Empty needle ExtensionDiscovery.php:302 [warning]
The following module is missing from the file system: standart bootstrap.inc:235 [warning]
Error: Call to a member function getPath() on null in /private/var/www/drupal/drupal8/core/includes/install.core.inc on line 793 #0 /private/var/www/drupal/drupal8/core/includes/install.core.inc(679): install_tasks(Array)
#1 /private/var/www/drupal/drupal8/core/includes/install.core.inc(531): install_tasks_to_perform(Array)
#2 /private/var/www/drupal/drupal8/core/includes/install.core.inc(115): install_run_tasks(Array)
#3 /usr/local/Cellar/drush/8.1.3/libexec/includes/drush.inc(726): install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#4 /usr/local/Cellar/drush/8.1.3/libexec/includes/drush.inc(711): drush_call_user_func_array('install_drupal', Array)
#5 /usr/local/Cellar/drush/8.1.3/libexec/commands/core/drupal/site_install.inc(80): drush_op('install_drupal', Object(Composer\Autoload\ClassLoader), Array)
#6 /usr/local/Cellar/drush/8.1.3/libexec/commands/core/site_install.drush.inc(247): drush_core_site_install_version('standart', Array)
#7 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(373): drush_core_site_install('standart')
#8 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(224): _drush_invoke_hooks(Array, Array)
#9 /usr/local/Cellar/drush/8.1.3/libexec/includes/command.inc(192): drush_command('standart')
#10 /usr/local/Cellar/drush/8.1.3/libexec/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#11 /usr/local/Cellar/drush/8.1.3/libexec/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#12 /usr/local/Cellar/drush/8.1.3/libexec/drush.php(12): drush_main()
#13 {main}
Error: Call to a member function getPath() on null in install_tasks() (line 793 of /private/var/www/drupal/drupal8/core/includes/install.core.inc).
Drush command terminated abnormally due to an unrecoverable error.
Comment | File | Size | Author |
---|---|---|---|
#12 | core-do_not_allow_invalid_profile_names-2425015-12.patch | 3.76 KB | BR0kEN |
Comments
Comment #1
fgmNoticed this today too. Of course, in the Web UI, profiles are selected from a list of available values, so the problem can not be triggered.
In today's HEAD, this is at line 771 of install.core.inc, where install_tasks() accesses profile date without assessing whether or not they are present, probably assuming only a valid profile may have been passed for install. I would say this is not a Drush issue, at least not entirely, especially since the param documentation for $install_state, from which the profile name is drawn, mentions the variability of the $install_state content.
So IMHO, this is a core bug.
Comment #2
fgmPossible patch : add the profile to the list of missing extensions during the requirements check, and don't barf elsewhere on this.
Comment #3
mgiffordPatch no longer applies.
Comment #4
csheltonlcm CreditAttribution: csheltonlcm commentedI've rerolled the patch; I didn't need to change anything, it auto merged just fine; however I didn't have any trouble applying the original patch either.
Comment #5
heykarthikwithu#4 patch applies.
Comment #6
heykarthikwithuComment #7
andypostlooks like duplicate
Comment #8
ajalan065 CreditAttribution: ajalan065 as a volunteer and at Innoraft commentedI have reviewed the last patch in comment #4
And here is my review.
1. First of all, the patch applies neatly to the issue, without any conflicts.
2. It passes the Drupal Coding Standards.
(a) Indenting done with 2 spaces, and no tabs.
(b) Proper Control Structure and Line length wrapping
(c) Comments and Naming Conventions followed.
3. Comments are readable and grammatically correct.
4. No duplicacy, code is efficient and the patch's test sufficient.
Comment #11
BR0kENComment #12
BR0kENComment #13
BR0kENI've decided to use already existing
$profile
variable instead of$install_state['parameters']['profile']
, because the last one could be changed by thePROFILE_install_tasks()
hook.Comment #26
smustgrave CreditAttribution: smustgrave at Mobomo commentedThis issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.
The issue described in the issue summary I was not able to reproduce I get
When I apply the patch I get
Even though the error is not reproducible maybe the message listing the installation profiles could be an improvement?
Moving to NW for the issue summary update.
If not a valid feature please close.