Description

When using the advanced search form created with the << AdvancedSearch >> macro (i.e. on the FindPage page) and you select multiple categories by holding the ctrl key the resulting query will have the categories separated by commas like category:CategoryOne,CategoryTwo instead of the correct form of category:CategoryOne category:CategoryTwo.

Steps to reproduce

  1. Go to http://moinmo.in/FindPage

  2. In the Category drop down select "CategoryEasy" then hold down ctrl and also select "CategoryMoinMoinPatch"

  3. Click "Go get it!" and it you will get the response 'Your search query "category:CategoryEasy,CategoryMoinMoinPatch" didn't return any results' even though there are pages that are assigned to both categories.

Example

Component selection

Details

MoinMoin Version

1.9.1

OS and Version

Ubuntu 9.10

Python Version

2.6.4

Server Setup

Server Details

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

Workaround

The problem is with the way that 'needle' is built in action/fullsearch.py. Here is a patch to fix it:

   1 --- /home/sremington/Downloads/moin-1.9.1/MoinMoin/action/fullsearch.py 2010-01-18 07:49:31.000000000 -0500
   2 +++ fullsearch.py       2010-02-26 10:32:52.000000000 -0500
   3 @@ -144,7 +144,8 @@
   4          word_re = re.compile(r'(\"[\w\s]+"|\w+)')
   5          needle = ''
   6          if categories[0]:
   7 -            needle += 'category:%s ' % ','.join(categories)
   8 +            for category in categories:
   9 +                needle += 'category:%s ' % category
  10          if language[0]:
  11              needle += 'language:%s ' % ','.join(language)
  12          if mimetype[0]:

Discussion

/!\ mimetype and language is implemented in same way. looks like 1.8 has same issue.

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/AdvancedSearchWithMultipleCategoriesSelected (last edited 2010-02-28 14:22:19 by ThomasWaldmann)