Submitted by : simon at: 2008-05-10T12:22:40-07:00 (9 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

The page hierarchy has gone blank. Don't just fix it.. debug it.

... --Simon Michael, Sat, 10 May 2008 22:13:32 -0700 reply

It self-healed before I could debug it. Oh Darn.

... --simon, Sat, 17 May 2008 11:16:24 -0700 reply

Status: open => closed

Similar Issue? --Warren H. Holt, Wed, 04 Jun 2008 05:38:37 -0700 reply

My Environment: Zope 2.9.7, ZWiki 0.51.0

I have a small ZWiki site I play with at work which I export and take home from time to time. Somehow, it has developed a problem where I can no longer import it at home. I have simply lived with the problem for some time but recently decided to address it. What I have found might help to debug your problem (even though you closed it).

I began by renaming my old site and creating a new ZWiki. Just a basic site. I began by entering my main page then just walked thru its links, most of which were free-form links (ie: ‘[…]?’). As I did, I noticed page hierarchy was working. Since my problem was with exporting and importing, once I had some of the site finished, I exported it, renamed the existing site, then imported what I exported. Page hierarchy was gone!

Not knowing why, I assumed it was the export / import mechanism. So I deleted the site I just imported then undid the rename for the original site. Again, page hierarchy was gone. Now puzzled, I did a ‘upgradeAll’ on my main page. Page hierarchy came back!

I did a rename and page hierarchy was gone again. A ‘upgradeAll’ on the main page brought them back. I did an export / import. Page hierarchy was gone again. A ‘upgradeAll’ again restored them.

I saw this issue and thought my experience might help.

Additional Debug Info --Warren H. Holt, Fri, 06 Jun 2008 11:09:17 -0700 reply

This is the source of a page that worked properly - like after an upgradeAll

 <!-- page name (and parents) -->
 <td class="pagenameand" align="left" width="79%">

 <small><ul class="aqtree3clickable">
 <li><a href="http://10.70.16.41:8080/whhwk/WarrensWorkZWikiSite" name="Warren%27s%20Work%20ZWiki%20Site">
  Warren's Work ZWiki Site</a>
<ul>
 <li><big><big><big><big><strong><a href="http://10.70.16.41:8080/whhwk/FunnyStuff/backlinks" title="which pages link to
    this one ?" name="Funny Stuff">Funny Stuff</a></strong></big></big></big></big></li>
</ul>
 </li>
</ul>

</small>

This is the source of a page that was not working properly - caused by a rename

 <!-- page name (and parents) -->
 <td class="pagenameand" align="left" width="79%">

 <small><ul class="aqtree3clickable">
 <li><big><big><big><big><strong><a href="http://10.70.16.41:8080/whhwk_a/FunnyStuff/backlinks" title="which pages link
    to this one ?" name="Funny Stuff">Funny Stuff</a></strong></big></big></big></big> ...
 </li>
</ul>

</small>

What I noticed...

  • The function context in OutlineSupport.py is responsible for the above
  • I noticed the second source snippit was ending with ' ...' (space and three dots)
  • The code responsible for this is in renderNesting.

Here is a snippet from renderNesting...

for n in nesting:
    if type(n) == ListType:
        if not (n[0]==here and suppress_current): #XXX temp
            got.append('%s <li>%s' % (indent,renderContentsLink(n[0])))
        if len(n) > 1:
            if not (n[0]==here and suppress_current): #XXX temp
                got.append('<ul>')
            for i in n[1:]:
                if type(i) == ListType:
                    got = self.renderNesting(
                        [i],
                        here=here,
                        enlarge_current=enlarge_current,
                        suppress_hyperlink=suppress_hyperlink,
                        suppress_current=suppress_current,
                        did=did,
                        got=got,
                        indent=indent+' ')
                else:
                    got.append('%s <li>%s</li>' % (indent,renderContentsLink(i)))
            if not (n[0]==here and suppress_current): #XXX temp
                got.append("</ul>")
        else:
            got[-1] += ' ...' # a parent whose children were omitted
        if not (n[0]==here and suppress_current):
            got.append('%s </li>' % indent)
    else:
        got.append('%s <li>%s</li>' % (indent,renderContentsLink(n)))

So...

  • The type passes the ListType test but has a length equal to 1
  • This suggests there is a single character put into the list by a rename (or other action)

p.s.: I modifed the format of the source above so it would display as I wanted on this reStructured text page.