Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined variable: name generate.make.inc:304 #2526

Closed
gh640 opened this issue Dec 30, 2016 · 2 comments
Closed

Undefined variable: name generate.make.inc:304 #2526

gh640 opened this issue Dec 30, 2016 · 2 comments

Comments

@gh640
Copy link

gh640 commented Dec 30, 2016

My environment is:

  • PHP: 5.6.20
  • Drupal: 7.53
  • Drush: 8.1.4

The command drush generate-makefile generates warning messages like below.

$ drush generate-makefile result.make
Undefined variable: name generate.make.inc:304
Undefined variable: name generate.make.inc:304
Undefined variable: name generate.make.inc:304

Seeing the code, the variable $name is not defined in the scope. Probably it should be passed to the function.

/**
 * Helper function to check for a non-default installation location.
 */
function _drush_generate_makefile_check_path($name, $project) {
  $info = array();
  $type = $project['type'];
  $path = dirname($project['path']);
  // Check to see if the path is in a subdir sites/all/modules or
  // profiles/profilename/modules
  if (preg_match('@^sites/[a-zA-Z0-9_]*/' . $type . 's/..*@', $path) || preg_match('@^sites/[a-zA-Z0-9_]*/' . $type . 's/..*@', $path)) {
    $subdir = preg_replace(array('@^[a-zA-Z0-9_]*/[a-zA-Z0-9_]*/' . $type . 's/*@', "@/$name" . '$@'), '', $path);
    if (!empty($subdir)) {
      $info['subdir'] = $subdir;
    }
  }
  return $info;
}
@gh640
Copy link
Author

gh640 commented Dec 30, 2016

I created a pull request for this after testing the patch in my environment:

#2527

Thank you in advance.

@greg-1-anderson
Copy link
Member

Make is deprecated. Closing old issues.

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

No branches or pull requests

2 participants