Tags:
create new tag
, view all tags

Bug: Parsing of a formatted search breaks

When entering legal wiki constructions in a formatted search, not all of them are working. This is not a regular expression problem I believe. In particular

  • linking of wiki words interferes
  • and linking through the [[...]] notation breaks.
Note that the first of these can be fixed by wraping < noautolink>...< /noautolink> around the search.

Test case

Take a look at these two queries:

<noautolink>
<form action="%SCRIPTURLPATH%/search%SCRIPTSUFFIX%/%INCLUDINGWEB%/">
     <input type="hidden" name="scope" value="True" /> 
     <input type="hidden" name="web" value="Main" /> 
     <input type="text"   name="search" size="32" />
     <input type="submit" value="Search" /> <br> 
     <input type="hidden" name="header" value="|*Installation*|*Description*|" />
     <input type="hidden" name="format" value="|$web.$topic |$formfield(TypeOfOrganization) |" />
</form>
</noautolink>


<noautolink>
<form action="%SCRIPTURLPATH%/search%SCRIPTSUFFIX%/%INCLUDINGWEB%/">
     <input type="hidden" name="scope" value="True" /> 
     <input type="hidden" name="web" value="Main" /> 
     <input type="text"   name="search" size="32" />
     <input type="submit" value="Search" /> <br> 
     <input type="hidden" name="header" value="|*Installation*|*Description*|" />
     <input type="hidden" name="format" value="|[[$web.$topic][$formfield(TWikiInstalledAt)]] |$formfield(TypeOfOrganization) |" />
</form>
</noautolink>


$formfield(TWikiInstalledAt) |$formfield(TypeOfOrganization) |" />

Notice the garbage below the second query... Note that we can make the form come out right by prefixing each of the [ symbols by a \, but then the formatting of the query is incorrect, as the \ is taken literally.

Environment

TWiki version: Athens, Beijing
TWiki plugins: twiki.org
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser: IE

-- ThomasWeigert - 04 May 2003

Follow up

This could be fixed, but is a quiet expensive runtime check for a special case. Better to escape problematic text with <nop> which gets removed before the rendered text is returned to the browser. As in:

<form action="%SCRIPTURLPATH%/search%SCRIPTSUFFIX%/%MAINWEB%/">
     <input type="hidden" name="scope" value="text" /> 
     <input type="hidden" name="web" value="Main" /> 
     <input type="text"   name="search" size="32" />
     <input type="submit" value="Search" />
     <input type="hidden" name="header" value="|*View*|*Installation*|*Type*|" />
     <input type="hidden" name="format" value="|[<nop>[$web.$topic][view]]|$formfield(<nop>TWikiInstalledAt) |$formfield(<nop>TypeOfOrganization) |" />
</form>

BTW, to make this example work nicely we'd need SearchTopicNameAndTopicText.

-- PeterThoeny - 05 May 2003

Fix record

Topic revision: r2 - 2003-05-05 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.