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

Unable to load class Drush\Sql\Sql #234

Open
herbdool opened this issue Dec 14, 2020 · 0 comments
Open

Unable to load class Drush\Sql\Sql #234

herbdool opened this issue Dec 14, 2020 · 0 comments

Comments

@herbdool
Copy link

herbdool commented Dec 14, 2020

I tried running drush sql-conf --all and it gives me "Unable to load class Drush\Sql\Sql. Error: Call to a member function getAll() on null in drush_sql_conf() (line 213 of phar:///usr/local/bin/drush/commands/sql/sql.drush.inc)."

It can't load an sql version class.

$sqlVersion = drush_sql_get_version();
    return $sqlVersion->getAll();

Note: I'm attempting this in lando with two databases so I can't confirm it's a general error.

And following the trail:

function drush_sql_get_version() {
  return drush_get_class('Drush\Sql\Sql', array(), array(drush_drupal_major_version())) ?: NULL;
}

So it's choking on drush_drupal_major_version(). It needs the Drupal version so it can append it to the end of the class. For example in /lib/Drush/Sql/Sql7.php there is class Sql7 extends SqlVersion.

I believe this is also related to the CiviCRM commands for SQL aren't able to find the right database. The CiviCRM drush commands have the right global $GLOBALS['databases']['default']['default'] but it can't find or use the sql class.

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

No branches or pull requests

1 participant