]> git.mjollnir.org Git - s9y.git/commitdiff
fix pgsql problem with entry quicksearch, thanks to Robert Treat
authorgarvinhicking <garvinhicking>
Fri, 30 Dec 2005 15:38:14 +0000 (15:38 +0000)
committergarvinhicking <garvinhicking>
Fri, 30 Dec 2005 15:38:14 +0000 (15:38 +0000)
docs/NEWS
include/functions_entries.inc.php

index d091418e9a6276ef9339b32a7c35cfd44f48a13b..144e47c31cd7f10d508a6ed7cec593bdb6c568ce 100644 (file)
--- 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)
index 5644446b647df222876ea655d27c4303526a673d..a0d18098d24e95cd8a5bffa35616fa3da05547c5 100644 (file)
@@ -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 : '')
                                                     );