Hi 

I had trouble rendering some of our Swikis 
to a normal website. The problem was that after 
rendering a few pages it stopped and I got the 
message 'Document contains no data' on the Webbrowser.
I started an investigation and discovered, I think,
the reason for the problem and a fix for it.


Version:  Comanche 4.10 / Swiki 1.1

Class:  PageFormatter
Method: #renderInternalLinks:request:response:shelf:book:page:

Offensive code:  (at the end of the method)

   ...

   alias = ''
     ifTrue: [location = ''
                ifTrue: [^ '<a href="' , lPage id asString , '.html">'
                           , (lPage showNameRequest: request book: book) , '</a>'].
              ^ '<a href="' , lPage id asString , '.html' , location , '">'
                , (lPage showNameRequest: request book: book) , ' (' , rawLocation , 
')</a>'].       
   ...


Problem:  The selector #showNameRequest:book: does not exist. Not in the class
          NuSwikiPage, which it is sent to, nor anywhere else. 
         
Solution: What is meant is most probably #showName, i.e. the code should
          look like this (note that I have to change it in two locations):


   ...
        
   alias = ''
     ifTrue: [location = ''
                ifTrue: [^ '<a href="' , lPage id asString , '.html">'
                           , lPage showName , '</a>'].
              ^ '<a href="' , lPage id asString , '.html' , location , '">'
                , lPage showName , ' (' , rawLocation , ')</a>'].
   ...


This modified code generated the correct HTML and rendered all my pages. 

Cheers

                Matthias 
                
                
                
Matthias Rieger           tel university    +41 31 631 35 47
SCG, University of Berne             www    http://www.iam.unibe.ch/~rieger

   |--     A Microsoft Certified Systems Engineer is to computing    --|
   |-- what a McDonalds Certified Food Specialist is to fine cuisine --|



Reply via email to