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.
Attempted to install modernizr module using: drush pm-enable modernizr.
Site crashed and received following error:
PHP Fatal error: Call to undefined function _modernizr_scan_for_library() in /var/www/html/sites/all/modules/modernizr/drush/modernizr.drush.inc on line 98
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined function _modernizr_scan_for_library() in
/var/www/html/sites/all/modules/modernizr/drush/modernizr.drush.inc,
Comment | File | Size | Author |
---|---|---|---|
#11 | 2127469-module-include.patch | 544 bytes | rupl |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedUpdate. Site did not crash after all, lowered priority to normal. Error reported but module seems to be installed. cleared cache using "drush cc".
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #3
ruplThat's quite strange since that function is in the .module file: http://drupalcode.org/project/modernizr.git/blob/refs/heads/7.x-3.x:/mod...
I see that the drush.inc calls it here: http://drupalcode.org/project/modernizr.git/blob/refs/heads/7.x-3.x:/dru...
I've never seen this error. Is there any additional information you could provide?
Comment #4
ruplComment #5
Zsuffa Dávid CreditAttribution: Zsuffa Dávid commentedSame issue here. Drush install and enable followed by this error:
Drupal version : 7.26
Drush version : 5.4
I have Libraries API enabled. The modernizr library has not downloaded.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commented@zsuffad try a drush cc all, that seemed to clear up the issue for me.
Comment #7
ruplI'm sorry I can't figure out why this is happening. I took another look at this during DrupalCamp Frankfurt with 7.26 and I still can't reproduce. But I won't close until we can nail this down why it's happening.
Comment #8
cmonnow CreditAttribution: cmonnow commentedI can confirm I had the same issue. I disabled and uninstalled the module before running "sudo drush cc all" and the subsequent installation progressed without errors.
(At first I thought it was some obscure new feature of Drupal/drush to block when a function with an underscore at the beginning of its name (to indicate internal/private functions) is called externally but I have no idea now).
Comment #9
leandro713 CreditAttribution: leandro713 commentedsame crash here.
drush downloaded the module but not the library.
i installed the library with «drush mdl»
Comment #10
hass CreditAttribution: hass commentedI think you need to
module_load_include()
the .module file. Otherwise Drush loads the drush.inc only and no other files what results such type of errors.Comment #11
ruplThank you @hass for the suggestion. As I mentioned earlier in this issue, I have never been able to reproduce, so if someone could test this patch and RTBC I'm happy to commit.