From: garvinhicking Date: Fri, 30 Dec 2005 15:38:14 +0000 (+0000) Subject: fix pgsql problem with entry quicksearch, thanks to Robert Treat X-Git-Tag: 0.9.1~5 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3e2422ecb2ecb145b68855a96b363c6f6e682afe;p=s9y.git fix pgsql problem with entry quicksearch, thanks to Robert Treat --- diff --git a/docs/NEWS b/docs/NEWS index d091418..144e47c 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,10 @@ Version 0.9.2 () ------------------------------------------------------------------------ + * Fix entry quicksearch on postgresql, where it returned the same + entry multiple times if it was contained in multiple categories. + Fix by Robert Treat, many thanks! + * Make templatechooser plugin emit a non-cached version of the stylesheet, so that user-changes will be visible without manually purging the cache (garvinhicking) diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index 5644446..a0d1809 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -4,11 +4,11 @@ function serendipity_deleteCategory($category_range, $admin_category) { global $serendipity; - + if (!serendipity_checkPermission('adminCategoriesDelete')) { return false; } - + serendipity_plugin_api::hook_event('backend_category_delete', $category_range); return serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}category WHERE category_left BETWEEN {$category_range} {$admin_category}"); @@ -231,7 +231,7 @@ function serendipity_fetchEntries($range = null, $full = true, $limit = '', $fet $group = 'GROUP BY e.id'; $distinct = ''; } - + serendipity_ACL_SQL($cond); // Store the unique query condition for entries for later reference, like getting the total article count. @@ -478,7 +478,7 @@ function serendipity_fetchCategories($authorid = null, $name = null, $order = nu ON c.authorid = $sql_authorid LEFT OUTER JOIN {$serendipity['dbPrefix']}authorgroups AS ag ON ag.authorid = a.authorid - LEFT OUTER JOIN {$serendipity['dbPrefix']}access AS acl + LEFT OUTER JOIN {$serendipity['dbPrefix']}access AS acl ON (ag.groupid = acl.groupid AND acl.artifact_id = c.categoryid) $where $group"; @@ -570,7 +570,6 @@ function serendipity_searchEntries($term, $limit = '') { e.authorid, a.realname AS author, a.email, - ec.categoryid, e.timestamp, e.comments, e.title, @@ -710,7 +709,7 @@ function serendipity_printEntries($entries, $extended = 0, $preview = false) { } $authorData = array( - 'authorid' => $entry['authorid'], + 'authorid' => $entry['authorid'], 'username' => $entry['author'], 'email' => $entry['email'], 'realname' => $entry['author'] @@ -1127,7 +1126,7 @@ function serendipity_printArchives() { $s = serendipity_serverOffsetHour(mktime(0, 0, 0, $m, 1, $y), true); $e = serendipity_serverOffsetHour(mktime(23, 59, 59, $m, date('t', $s), $y), true); - $entries = serendipity_db_query("SELECT count(id) + $entries = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}entries e LEFT JOIN {$serendipity['dbPrefix']}entrycat ec ON e.id = ec.entryid @@ -1135,7 +1134,7 @@ function serendipity_printArchives() { ON ec.categoryid = c.categoryid WHERE isdraft = 'false' AND timestamp >= $s - AND timestamp <= $e " + AND timestamp <= $e " . (!serendipity_db_bool($serendipity['showFutureEntries']) ? " AND timestamp <= " . time() : '') . (!empty($cat_sql) ? ' AND ' . $cat_sql : '') );