aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-05-24 11:14:54 +0000
committerplegall <plg@piwigo.org>2010-05-24 11:14:54 +0000
commitd3fc7fd446db015339e5b1356a65b444d534ffce (patch)
tree99440328bf52761a04eb268d8d3cd670ad0dae81
parentadfcba658e484faa801c1a962750caa093b424a8 (diff)
merge r6321 from branch 2.1 to trunk
bug 1682: r6312 was producing a MySQL error (depending on the MySQL server version) because a count() implies a group by. This code change was checked against MySQL 5.0.75, MySQL 5.0.51 (where the error occured) and SQLite 3.6.22. git-svn-id: http://piwigo.org/svn/trunk@6322 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/functions_user.inc.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 0c9412e38..3ba596633 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -301,10 +301,11 @@ SELECT
LEFT JOIN '.USER_CACHE_TABLE.' AS uc ON ui.user_id = uc.user_id
LEFT JOIN '.THEMES_TABLE.' AS t ON t.id = ui.theme
WHERE ui.user_id = \''.$user_id.'\'
+ GROUP BY ui.user_id
;';
$result = pwg_query($query);
$user_infos_row = pwg_db_fetch_assoc($result);
- if (0 == $user_infos_row['counter']) {
+ if (!isset($user_infos_row['counter']) or 0 == $user_infos_row['counter']) {
create_user_infos($user_id);
$result = pwg_query($query);