Index: lib/eztemplate/classes/eztemplatecompiler.php
===================================================================
--- lib/eztemplate/classes/eztemplatecompiler.php	(revision 22910)
+++ lib/eztemplate/classes/eztemplatecompiler.php	(working copy)
@@ -2687,7 +2687,7 @@
                         if ( isset( $variableParameters['local-variable'] ) )
                         {
                             $php->addCodePiece( "if ( \$tpl->hasVariable( $variableNameText, $namespaceText ) )\n{\n" ); // if the variable already exists
-                            $php->addCodePiece( "    \$tpl->warning( '" . eZTemplateDefFunction::DEF_FUNCTION_NAME . "', \"Variable $variableNameText is already defined.\" );\n" );
+                            $php->addCodePiece( "    \$tpl->warning( '" . eZTemplateDefFunction::DEF_FUNCTION_NAME . "', \"Variable $variableNameText is already defined.\", " . $php->thisVariableText( $variablePlacement ) . " );\n" );
                             $php->addCodePiece( "    \$tpl->setVariable( $variableNameText, $variableText, $namespaceText );\n}\nelse\n{\n" );
                             $php->addCodePiece( "    \$tpl->setLocalVariable( $variableNameText, $variableText, $namespaceText );\n}\n" ,
                                                 array( 'spacing' => $spacing ) );
Index: lib/eztemplate/classes/eztemplatedeffunction.php
===================================================================
--- lib/eztemplate/classes/eztemplatedeffunction.php	(revision 22910)
+++ lib/eztemplate/classes/eztemplatedeffunction.php	(working copy)
@@ -164,7 +164,7 @@
             if ( $undef ) // {undef}
             {
                 if ( !$tpl->hasLocalVariable( $varName, $rootNamespace ) )
-                    $tpl->warning( eZTemplateDefFunction::UNDEF_FUNCTION_NAME, "Variable '$varName' is not defined with {def}." );
+                    $tpl->warning( eZTemplateDefFunction::UNDEF_FUNCTION_NAME, "Variable '$varName' is not defined with {def}.", $functionPlacement );
                 else
                     $tpl->unsetLocalVariable( $varName, $rootNamespace );
 
@@ -174,11 +174,7 @@
                 if ( $tpl->hasVariable( $varName, $rootNamespace ) ) // if the variable already exists
                 {
                     // we don't create new variable but just assign value to the existing one.
-                    $tpl->warning( eZTemplateDefFunction::DEF_FUNCTION_NAME
-                                   . ' in ' . $functionPlacement[2]
-                                   . '[' . $functionPlacement[1][0] . ']'
-                                   . ':' . $functionPlacement[1][1],
-                                   "Variable '$varName' is already defined." );
+                    $tpl->warning( eZTemplateDefFunction::DEF_FUNCTION_NAME, "Variable '$varName' is already defined.", $functionPlacement );
                     $tpl->setVariable( $varName, $varValue, $rootNamespace );
                 }
                 else
