Skip to content

Conversation

@EvanLovely
Copy link
Member

@EvanLovely EvanLovely commented Apr 29, 2016

To recreate:

composer create-project pattern-lab/edition-drupal-standard

Select any starterkit (preferably pattern-lab/starterkit-twig-drupal-minimal) and you'll see this error (ran with -vvv):

2016-04-29 at 12 08 pm

I hunted the error down to Fetch.php's mirrorDist() seen here.

// if source directory isn't empty ask if it's ok to nuke what's there
if (!$emptyDir) {

  $prompt    = "a starterkit is already installed. merge the new files with it or replace it?";
  $options   = "M/r";
  $input     = Console::promptInput($prompt,$options);
  $fsOptions = ($input == "r") ? array("delete" => true, "override" => true) : array("delete" => false, "override" => false);

}

// mirror dist to source
Console::writeInfo("installing the starterkit files...");
$fs = new Filesystem();
$fs->mirror($tempDirDist, $sourceDir, null, $options); // ERROR HAPPENS HERE
Console::writeInfo("starterkit files have been installed...");

It's always worked before because the code in if (!$emptyDir) was always ran, which set $options to "M/r". When that conditional doesn't run it's code block, we get the cause of the error: Undefined variable: options. I can tell that the $options set is for Console::promptInput() and isn't intended for $fs->mirror(), because the Symfony Filesystem mirror function wants $options to be an array and not a string. So basically this PR just removes the $options from $fs->mirror():

- $fs->mirror($tempDirDist, $sourceDir, null, $options);
+ $fs->mirror($tempDirDist, $sourceDir, null);

Would be really great to get this soon as this prevents the Drupal Edition from getting launched!! 🙏

@dmolsen dmolsen merged commit 25c71af into pattern-lab:master Apr 29, 2016
@EvanLovely EvanLovely deleted the hotfix/starterkit-installs-w-prev-source branch April 29, 2016 19:54
@dmolsen
Copy link
Member

dmolsen commented May 15, 2016

This was a bad merge on my part. The name of the var should have been $fsOptions. It will be making a re-appearance in v0.7.3 of core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants