[Pmwiki-users] Group/SearchWiki?

Patrick R. Michaud pmichaud
Thu Mar 18 09:32:23 CST 2004


On Thu, Mar 18, 2004 at 05:12:56PM +0100, Thomas -Balu- Walter wrote:
> On Tue, Mar 16, 2004 at 09:05:12PM -0700, Patrick R. Michaud wrote:
> > In general, anything that might have a WikiWord in it needs to be 
> > processed in $DoubleBrackets or $BrowseDirectives (i.e., before WikiWord
> > processing takes place). 
> 
> Next showstopper which made me crazy the last three hours :)
> 
> Why, how and where is $Needle filled on previewing pages? 
> I thought my code has something wrong, but I finally noticed that if you
> preview http://www.pmichaud.com/wiki/Main/SearchWiki you will get the
> same result: the whole page content is inserted into the Search-field...

Oops!  Interesting. 

$Needle and $SearchGroup are set by scripts/search.php from the 
contents of the "text" variable (from a GET/POST request).  Of course,
this is the same "text" variable that is used when doing edits
and previews, which is why $Needle is being replaced when a preview
is performed.

In retrospect it would've been nice to have the two items use different
names (i.e., "searchtext=" or "q=" for searches, "edittext=" for editing), 
but by the time I realized the potential problem sometime in the
middle of the 0.5 releases, I felt it was too far entrenched in existing
releases without making a major revision change.  Indeed, you're the
first to have noticed it.  :-)

The quick fix is to have search.php set $Needle and $SearchGroup only if the
action is 'browse' or 'search'.  I'll do this for the next release.

Pm



More information about the pmwiki-users mailing list