Description

A fresh installation with the page LanguageSetup only shows navibar links to pages which don't exist.

If a user creates one of these pages he never get the underlay page shown after it is installed.

It hink we should hide navibar tabs which don't exist or which the user may not be able to access because of acls.

Component selection

Details

this wiki

Workaround

Discussion

That's not a bug, navibar is just a bunch of links. A link does not require the target to exist. (note: a more "wiki like" behaviour would be to show grey link, but that has same performance impact, see below)

And if you create wrong pages, you'll just have to delete them again.

"Fixing" that in the way shown below will make theme even slower because every link there will do one Page.exists() call (and some people have many links in the navibar).

   1 diff -r f992fed6e94a MoinMoin/theme/__init__.py
   2 --- a/MoinMoin/theme/__init__.py	Sun Dec 06 00:29:33 2009 +0100
   3 +++ b/MoinMoin/theme/__init__.py	Mon Dec 07 18:38:28 2009 +0100
   4 @@ -461,12 +461,13 @@
   5          if request.cfg.navi_bar:
   6              for text in request.cfg.navi_bar:
   7                  pagename, link = self.splitNavilink(text)
   8 -                if pagename == current:
   9 -                    cls = 'wikilink current'
  10 -                else:
  11 -                    cls = 'wikilink'
  12 -                items.append(item % (cls, link))
  13 -                found[pagename] = 1
  14 +                if Page(request, pagename).exists() and self.request.user.may.read(pagename):
  15 +                    if pagename == current:
  16 +                        cls = 'wikilink current'
  17 +                    else:
  18 +                        cls = 'wikilink'
  19 +                    items.append(item % (cls, link))
  20 +                    found[pagename] = 1
  21  
  22          # Add user links to wiki links, eliminating duplicates.
  23          userlinks = request.user.getQuickLinks()
theme.patch

Plan


CategoryMoinMoinNoBug

MoinMoin: MoinMoinBugs/NavibarShowsNonExistingPages (last edited 2009-12-07 20:49:29 by ThomasWaldmann)