Description

On a category page <<FullSearch>> returns nothing.

Steps to reproduce

Example

Component selection

Details

MoinMoin Version

this wiki

OS and Version

Python Version

Server Setup

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

Workaround

replace it by the <<FullSearchCached(r:CategoryFeaturePatched\b)>> macro

or change it to <<FullSearch()>>

Discussion

diff -r 6decf2567879 MoinMoin/macro/FullSearch.py
--- a/MoinMoin/macro/FullSearch.py      Tue Dec 25 02:20:02 2007 +0100
+++ b/MoinMoin/macro/FullSearch.py      Tue Jan 01 18:03:22 2008 +0100
@@ -85,9 +85,15 @@ def execute(macro, needle):
     request = macro.request
     _ = request.getText

-    # if no args given, invoke "classic" behavior
     if needle is None:
-        return search_box("fullsearch", macro)
+        # if no args given and called on a Category page do list pages of this category
+        if wikiutil.filterCategoryPages(request, (macro.formatter.page.page_name, )):
+            needle = '"%s"' % macro.formatter.page.page_name
+            results = search.searchPages(request, needle, sort='page_name')
+            return results.pageList(request, macro.formatter, paging=False)
+        else:
+            # invoke "classic" behavior on other pages
+            return search_box("fullsearch", macro)

     # With empty arguments, simulate title click (backlinks to page)
     elif needle == '':

The patch should not be applied, because behaviour on category pages should not be different from other pages.

Reimar just fixed all category pages to search for their own name, because the search macro without arguments just rendered the search form, but did not do the search (as 1.5 did).

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/FullSearchOnCategoryPage (last edited 2008-02-03 10:26:48 by ReimarBauer)