From a037f0a822d44e1fd79e5fe488092b0ab8dbc1ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sun, 2 Oct 2011 20:56:41 +0200 Subject: [PATCH] Limits number of localities displayed in autocomplete, when restricted to a single country. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/direnum.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/direnum.php b/classes/direnum.php index f7100c5..5176c4a 100644 --- a/classes/direnum.php +++ b/classes/direnum.php @@ -625,7 +625,9 @@ class DE_Localities extends DE_AddressesComponents AND pac1.groupid = pac2.groupid AND pac1.type = pac2.type) INNER JOIN profile_addresses_components_enum AS pace2 ON (pac2.component_id = pace2.id AND FIND_IN_SET('country', pace2.types)) WHERE pace2.id = {?} AND FIND_IN_SET('locality', pace1.types) AND pac1.type = 'home' AND " . $where . " - GROUP BY pace1.long_name"; + GROUP BY pace1.long_name + ORDER BY nb DESC, field + LIMIT " . self::AUTOCOMPLETE_LIMIT; return XDB::fetchAllAssoc($query, $sub_id); } } -- 2.1.4