From b88c8d49b6948782150bc39f1d777570a957d032 Mon Sep 17 00:00:00 2001
From: Fil <fil@rezo.net>
Date: Tue, 23 Jan 2007 20:33:35 +0000
Subject: [PATCH] critere {traduction} fonctionne sur un article tout seul (cf.
 tests/criteres/traduction et
 http://thread.gmane.org/gmane.comp.web.spip.devel/38931/ (Paolo)

---
 ecrire/public/criteres.php | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/ecrire/public/criteres.php b/ecrire/public/criteres.php
index ce3fa74a6d..5c39739f45 100644
--- a/ecrire/public/criteres.php
+++ b/ecrire/public/criteres.php
@@ -171,11 +171,17 @@ function critere_traduction_dist($idb, &$boucles, $crit) {
 	$table = $boucle->id_table;
 	$arg = kwote(calculer_argument_precedent($idb, 'id_trad', $boucles));
 	$dprim = kwote(calculer_argument_precedent($idb, $prim, $boucles));
-	$boucle->where[]= array("'AND'",
-		array("'>'", "'$table.". "id_trad'", 0),
+	$boucle->where[]=
 		array("'OR'",
-			array("'='", "'$table." . "id_trad'", $arg),
-			array("'='", "'$table.$prim'", $dprim)));
+			array("'AND'",
+				array("'='", "'$table.id_trad'", 0),
+				array("'='", "'$table.$prim'", $dprim)
+			),
+			array("'AND'",
+				array("'>'", "'$table.id_trad'", 0),
+				array("'='", "'$table.id_trad'", $arg)
+			)
+		);
 }
 
 // {origine_traduction}
-- 
GitLab