While running "drush hacked-diff" I was getting:

PHP Fatal error: Call to undefined function hacked_project_load() in /path/to/hacked/hacked.drush.inc on line 265.

It looks as though Drush support hasn't been fully upgraded to Drupal 8.

I've got a patch I'll upload shortly.

Comments

colan created an issue. See original summary.

colan’s picture

Status: Active » Needs review
StatusFileSize
new1.84 KB
colan’s picture

Title: Drush hacked-diff command fails on D8 » Drush commands failing on D8
Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new2.25 KB

There's some more of the above going on here.

Besides changing the include path for batch.inc, the caching is the next thing to fix when running drush hacked-list-projects:

  • include_once(/path/to/drupal/includes/batch.inc): failed to open stream: No such file or directory hacked.drush.inc:84 [warning]
  • include_once(): Failed opening '/path/to/drupal/includes/batch.inc' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') hacked.drush.inc:84 [warning]
  • PHP Fatal error: Call to undefined function cache_get() in /path/to/hacked/hacked.drush.inc on line 87

We'll need to use the New cache API for that.

colan’s picture

Status: Needs work » Needs review
StatusFileSize
new4.17 KB

I think I got everything this time.

deciphered’s picture

+++ b/hacked.drush.inc
@@ -208,7 +208,7 @@ function drush_hacked_lock_modified() {
+          $project_ob = new Drupal\hacked\hackedProject($project['project_name']);

@@ -262,7 +262,7 @@ function drush_hacked_drush_command_validate($short_name = '') {
+  $project = new Drupal\hacked\hackedProject($short_name);

@@ -277,7 +277,7 @@ function drush_hacked_drush_command_validate($short_name = '') {
+  $project = new Drupal\hacked\hackedProject($short_name);

@@ -345,13 +345,15 @@ function drush_hacked_diff_validate($short_name = '') {
+  $project = new Drupal\hacked\hackedProject($short_name);

Given the multiple instances of hackedProject, you should 'use' the object at the top of the file and use the shortname (excluding namespace).

About to run the patch through a manual test and linting.

deciphered’s picture

Status: Needs review » Reviewed & tested by the community

Patch appears to work fine. Will commit and do a follow up cleanup commit (including the reviewed item above). Thanks for the hard work, it's greatly appreciated.

  • Deciphered committed 48f415a on 8.x-2.x authored by colan
    #2674924 by colan: Ported Drush integration to D8.
    
deciphered’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sarikak’s picture

This issue still exists:

Drupal Version : 8.2.2
Drush Version : 8.1.7
Steps to repeat:

  • Download Hacked! module 8.x-2.0-beta1 (drush dl hacked)
  • Enable the module (drush en -y hacked)
  • drush hacked-details token

Drush command terminated with of the following error:

PHP Fatal error:  Call to undefined function hacked_project_load() in /opt/lampp/htdocs/drupal-8.2.2/modules/hacked/hacked.drush.inc on line 265

Fatal error: Call to undefined function hacked_project_load() in /opt/lampp/htdocs/drupal-8.2.2/modules/hacked/hacked.drush.inc on line 265
Drush command terminated abnormally due to an unrecoverable error.