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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timmillwood created an issue. See original summary.

tripper54’s picture

Laravel 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.

dagmar’s picture

Can 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.

timmillwood’s picture

Status: Needs review » Reviewed & tested by the community

I'd be happy to see this, mostly people will be unaffected, but those of us who are seeing issues will not any more.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Fixed

Merged to 8.x. Thanks.

Status: Fixed » Closed (fixed)

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

e.ryan.schmidt@gmail.com’s picture

#3 patch works for me on D7 with PHP 5.6 and MySql 5.5 as well.

Rob230’s picture

Also confirming #3 applies to 7.x-1.5. Otherwise I was unable to use Drush while Devel was installed.

salvis’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
Status: Closed (fixed) » Needs review
marc.groth’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #3 works for Drupal 7. It would be great if this could be committed.

salvis’s picture

Status: Reviewed & tested by the community » Needs work

Sorry, but the patch still fails for the testbot.

dagmar’s picture

Status: Needs work » Needs review
FileSize
538 bytes

Updated for version 7.x

  • salvis committed 643407c on 7.x-1.x
    Issue #2559061 by dagmar: Fatal error: Cannot redeclare dd().
    
salvis’s picture

Status: Needs review » Fixed

Thanks dagmar and all!

Status: Fixed » Closed (fixed)

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