In the function drupal_debug() the output file is set to
$file = 'temporary://drupal_debug.txt';

However, I was wondering why it should be hard-coded, and would it be better to use
$file = file_directory_temp() . '/drupal_debug.txt';

With the hard-coded 'temporary:' I get an error when trying to use dd() during simpletest, saying that the wrapper 'temporary:' is unknown. If we used file_directory_temp() instead, then I can control where the output goes by using variable_set('file_temporary_path', '/my/tmp/path');. Currently the simpletest temp directory is different for each run, so locating the debug.txt file is tricky.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonathan1055’s picture

Status: Active » Needs review
FileSize
606 bytes

Patch against 7.x dev

pcambra’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Needs review » Needs work

Thanks for the patch, could you try if it applies for 8.x? it should go there first.

jonathan1055’s picture

OK, I will check. The code is identical, but I am having difficulty finding the Devel config options in D8. I've enabled the module but cannot find it in the 'Configuration' page with the spanner. I have the four core 'development' items, but nothing from this module.

pcambra’s picture

Status: Needs work » Fixed

Thanks @jonathan1055
Pushed to 7 & 8!

jonathan1055’s picture

Excellent, thank you. Cheers for giving authorship credit too.

Jonathan

Status: Fixed » Closed (fixed)

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