Description
OrphanedPages reports pages that belong to categories. This makes e.g. appear lots of MonthCalendar entries in the orphan report.
Steps to reproduce
Create e.g. a CategoryGlossary
- Create one or more pages and put them into that category
Open the OrphanedPages page
Example
Please, manually check the / T e s t P a g e page for an example. Linking it here directly will avoid the problem.
Details
This wiki.
Workaround
diff -u macro/OrphanedPages.py.orig macro/OrphanedPages.py --- macro/OrphanedPages.py.orig 2005-05-23 12:32:24.022316918 +0200 +++ macro/OrphanedPages.py 2005-05-23 12:34:22.767952018 +0200 @@ -18,8 +18,11 @@ pages = macro.request.rootpage.getPageDict() orphaned = {} orphaned.update(pages) - for page in pages.values(): - links = page.getPageLinks(macro.request) + for name in pages.keys(): + links = pages[name].getPageLinks(macro.request) + categories = pages[name].getCategories(macro.request) + if categories and orphaned.has_key(name): + del orphaned[name] for link in links: if orphaned.has_key(link): del orphaned[link]
There seems to be something wrong with my use of name though, because it should be possible, to put the for loop into an else part, but if I do this, there appear some 30 asian pages suddenly in the output of OrphanedPages.
Discussion
See above. It might be, that this is wanted behaviour, but it messes up maintaining dictionaries, glossaries, blogs and calendars.
It is not clear what is the correct behavior. The purpose of OrphanedPages is to find pages that no one care about, and possibly remove them from the wiki or move their content to another place.
The test for "care about" is links in other pages to those pages. If a person add a link to a page, the page is not considered orphaned. When you add a category to a page, you can see it as if the category page link automatically to the page, or not. We can implement the search in the category page to "link" to the category pages or not, it depends on the code used to render the page.
You can think about case when an admin put a category on all templates, and every page has a category by default. In this case, orphaned pages should show pages with categories. In another case, only some pages get categories, and maybe in this case, it make sense to not show the pages in orphaned pages list. Generally, categories are page meta data - they are links only because moin does not have better system to manage meta data.
If this is a problem with specific module like MonthCalendar, maybe it should be solve in that module.
Categories work after deleting the cache, I fixed that today. So just MonthCalendar is broken (it has other bugs as well, reason enough not to ship it like it is currently IMHO). -- AlexanderSchremmer 2005-05-23 20:44:00
Plan
- Priority:
- Assigned to:
Status: if anything a duplicate of MoinMoinBugs/OrphanedPagesListsIncludedPages