We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
Tags:
create new tag
, view all tags

Question

$formfield in formatted search returns empty string instead of value:

%SEARCH{... format="... $formfield(TopicClassification)... "}%

Found a workaround by patching getMetaFormField in Search.pm.

see NorbertGaworTest?

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: see twiki.org
Server OS: see twiki.org
Web server: see twiki.org
Perl version: see twiki.org
Client OS: SunOS5? .8
Web Browser: Mozilla Firefox
Categories: Forms, Search

-- NorbertGawor - 23 Sep 2005

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

There is an interference when using $text and $formfield in a SEARCH at the same time. I believe $text gets rendered before $formfield gets evaluated, hence $formfield contains HTML. As a workaround use a $pattern instead of $text when your are using $formfield.

See updated NorbertGaworTest?

-- PeterThoeny - 23 Sep 2005

Peter, thank you; the meta data are visible now but I cannot find a pattern which retrieves the same as $text, please see NorbertGaworTest?

-- NorbertGawor - 27 Sep 2005

$pattern((.*).*) does not work, .* must not be used within the pattern. This is a documented limitation of the parser, see FormattedSearch. The trick is to use a pattern that grabs everything within the parenthesis without using .*. I fixed your example to read $pattern(([^\e]*).*)

-- PeterThoeny - 27 Sep 2005

Thank you, Peter.

This works, even in our intranet.

I am just upgrading our TWiki to "03 Sep 2004" due to SecurityAlertExecuteCommandsWithRev.

May I hope DakarRelease will have eliminated these workarounds?

kind regards,

-- NorbertGawor - 28 Sep 2005

 
Topic revision: r5 - 28 Sep 2005 - 08:30:19 - NorbertGawor
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback