From 1305728502f43e5188987358ef7515d0c9cd26da Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 10 Feb 2011 13:03:20 +0100 Subject: [PATCH] Fixed ExprBuilder to really use the parameter when replacing a key with an attribute --- .../Configuration/Builder/ExprBuilder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Configuration/Builder/ExprBuilder.php b/src/Symfony/Component/DependencyInjection/Configuration/Builder/ExprBuilder.php index b0e63cc35e..3c9686448e 100644 --- a/src/Symfony/Component/DependencyInjection/Configuration/Builder/ExprBuilder.php +++ b/src/Symfony/Component/DependencyInjection/Configuration/Builder/ExprBuilder.php @@ -101,11 +101,11 @@ class ExprBuilder */ public function thenReplaceKeyWithAttribute($attribute) { - $this->thenPart = function($v) { + $this->thenPart = function($v) use ($attribute) { $newValue = array(); foreach ($v as $k => $oldValue) { - if (is_array($oldValue) && isset($oldValue['id'])) { - $k = $oldValue['id']; + if (is_array($oldValue) && isset($oldValue[$attribute])) { + $k = $oldValue[$attribute]; } $newValue[$k] = $oldValue;