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.
drush_hack.inc replaces Autoload's class loader with it's own implementation in drush tasks. This was an attempt to work around #547736: Autoload fails with drush which has now been fixed. Worse though, is that the code breaks autoloading if you use Autoload 6.x-2.x as autoload_get_lookup() doesn't return anything now:
http://drupalcode.org/project/autoload.git/blob/refs/heads/6.x-2.x:/auto...
As the code is now unneeded and it's probably a bad idea to use it, can we remove it?
Comment | File | Size | Author |
---|---|---|---|
#1 | messaging_6.x-4.x-remove-drush-autoload-workaround-1747982-1.patch | 1.54 KB | Dean Reilly |
Comments
Comment #1
Dean Reilly CreditAttribution: Dean Reilly commentedComment #2
Dean Reilly CreditAttribution: Dean Reilly commentedComment #3
Dean Reilly CreditAttribution: Dean Reilly commentedI've also posted a patch to the notifications tools issue queue to remove references to the file. #1748012: Module doesn't work with Autoload 2.x. Stop using drush_hack.inc.
Comment #4
jataylor CreditAttribution: jataylor commentedI'm trying to upgrade to Autoload 6.x-2.1, and everything seems to be working ok, except that even after removing the drush_hack.inc file I am getting this error:
PHP Fatal error: Class 'Messaging_Store' not found in /sites/all/modules/contrib/messaging/messaging.module on line 564
As far as I can tell though, nothing is actually breaking because of it. Do you have any idea what would cause this?
Comment #5
Dean Reilly CreditAttribution: Dean Reilly commentedHi jataylor,
Messaging still uses the old hook_autoload_info() method of defining classes (http://drupalcode.org/project/messaging.git/blob/refs/heads/6.x-4.x:/mes...) which is no longer supported by the latest version of autoload. You'll want to convert it to a files array in the info file (http://drupalcode.org/project/autoload.git/blob/refs/heads/6.x-2.x:/READ...). Something like:
Let me know how you get on. I'll do some testing over the weekend and update the patch then (unless you want to take a crack at it before then).
Comment #6
jataylor CreditAttribution: jataylor commentedThat appears to have fixed my issue, thanks Dean.