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 someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is 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

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2005-09-28 - NorbertGawor
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.