From e1c9c0427be30c858d9e82442f606eacc4b565f1 Mon Sep 17 00:00:00 2001 From: Dieter Holvoet Date: Sat, 3 Sep 2022 15:30:06 +0200 Subject: [PATCH] Exclude non-placeholder variables (#5215) --- src/Drupal/Commands/core/DeployHookCommands.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Drupal/Commands/core/DeployHookCommands.php b/src/Drupal/Commands/core/DeployHookCommands.php index 5517698de8..3e387439f9 100644 --- a/src/Drupal/Commands/core/DeployHookCommands.php +++ b/src/Drupal/Commands/core/DeployHookCommands.php @@ -204,7 +204,9 @@ public static function updateDoOneDeployHook(string $function, DrushBatchContext Drush::logger()->error($e->getMessage()); $variables = Error::decodeException($e); - unset($variables['backtrace']); + $variables = array_filter($variables, function ($key) { + return $key[0] == '@' || $key[0] == '%'; + }, ARRAY_FILTER_USE_KEY); // On windows there is a problem with json encoding a string with backslashes. $variables['%file'] = strtr($variables['%file'], [DIRECTORY_SEPARATOR => '/']); $ret['#abort'] = [