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.
I got the following error when running drush cr
Fatal error: Cannot redeclare dd() (previously declared in /home/vagrant/.composer/vendor/illuminate/support/helpers.php:437) in /home/vagrant/Code/drupal/modules/devel/devel.module on line 910
I use this vagrant box for both Drupal and laravel development, and looks like there is a conflict with the laravel support component.
https://github.com/illuminate/support/blob/master/helpers.php#L431
Comment | File | Size | Author |
---|---|---|---|
#13 | fatal-dd-2559061-12.patch | 538 bytes | dagmar |
| |||
#3 | fatal-dd-2559061-3.patch | 530 bytes | dagmar |
|
Comments
Comment #2
tripper54 CreditAttribution: tripper54 as a volunteer and commentedLaravel Homestead comes bundled with laravel/envoy (very cool library for deployment scripts), which depends on illuminate/support, which includes a bunch of global helper functions, including dd(), short for die & dump.
See
https://laravel.com/docs/5.1/envoy
https://laravel.com/docs/5.1/helpers
I think a non-namespaced global function in devel is a bad idea. dd() is simply an alias to drupal_debug. It should be removed. I think we can all type.
Having said that it looks like it's not the only collision, see https://github.com/laravel/framework/issues/6872
Perhaps using VDD instead of Homestead for drupal sites is the solution with the least grief.
Comment #3
dagmarCan we use the same solution than
illumitate
?I understand they don't use the same number of arguments, but this makes crash devel instalation. At least we give developers the oportunity to write drupal_debug if there is a function name conflict.
Comment #4
timmillwoodI'd be happy to see this, mostly people will be unaffected, but those of us who are seeing issues will not any more.
Comment #5
moshe weitzman CreditAttribution: moshe weitzman at Acquia commentedMerged to 8.x. Thanks.
Comment #8
e.ryan.schmidt@gmail.com CreditAttribution: e.ryan.schmidt@gmail.com as a volunteer commented#3 patch works for me on D7 with PHP 5.6 and MySql 5.5 as well.
Comment #9
Rob230 CreditAttribution: Rob230 as a volunteer commentedAlso confirming #3 applies to 7.x-1.5. Otherwise I was unable to use Drush while Devel was installed.
Comment #10
salvisComment #11
marc.groth CreditAttribution: marc.groth commentedPatch in #3 works for Drupal 7. It would be great if this could be committed.
Comment #12
salvisSorry, but the patch still fails for the testbot.
Comment #13
dagmarUpdated for version 7.x
Comment #15
salvisThanks dagmar and all!