Description

MoinMoin uses links to determine the categories of a page. This is a very easy way to categorize.

However if a macro generates a list of pages (including categories) the page automatically gets member of any of those categories. An extreme example is the page CategoryCategory which is in any category (normally one would expect all categories being in CategoryCategory not vice versa).

Normally the user doesn't expect that including a list of pages by a macro also categorizes the page. Normally this even isn't wanted. This also introduces recursions in the category hierarchy not intended by the user and sometimes even violating logic. For example category pages often contain a macro generating a list of all the pages belonging to that category (including subcategories). But this causes automatically the parent category being a subcategory of all of its subcategories, which generally is not logic nor intended.

Steps to reproduce

  1. Check the result of the Page.getCategories(request) function of the CategoryCategory page.

  2. Create a category named ParentCategory. The category should include the macro [[FullSearch()]].

  3. Create a category named ChildCategory. The category should be in ParentCategory.

  4. Check the result of the Page.getCategories(request) function of the ChildCategory page.

  5. Notice that the result will be [u'CategoryChild', u'CategoryParent']. This means that the page CategoryParent is in category CategoryChild and CategoryParent.

Component selection

A proposed simple solution is not to include the content of macros when determining the categories a page belongs to.

The easiest way to do this is to modify the pagelinks formatter adding the following lines to the Formatter class:

   1     def macro(self, macro_obj, name, args, markup=None):
   2         return ''

Details

This Wiki.

Workaround

Don't use macros like [[FullSearch()]] or [[PageList(...)]] or don't use themes relying on categorization.

Discussion

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/MacrosCategorizePages (last edited 2007-10-29 19:06:58 by localhost)