Tags:
create new tag
view all tags

Question

Can someone please tell me what is wrong with this search? It works, but it displays the entire CALC function with the results inside it...

%SEARCH{ "[T]opicClassification.*?value=\"[C]alendarEvents\"" scope="text" regex="on" nonoise="on" excludetopic="CalendarEvents" format="$percntCALC{$IF($TIME($formfield(EventDay) $formfield(EventMonth) $formfield(EventYear) ) < $TODAY(), <nop>, $topic $formfield(EventDay) $formfield(EventMonth) $formfield(EventYear) $formfield(EventTime) $formfield(EventContact) $formfield(EventDescription) $formfield(PostedBy) ) }$percnt"}%

Environment

TWiki version: TWikiRelease04x00x04
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories:  

-- CarlMcKinney - 19 Sep 2006

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.

Here's the search result here (swapping CarlMcKinney for the search string)

CalcInCommentPluginTemplate ConditionalSearchDisplaysCalc EditFormBackgroundColor EmailDoesNotGetCopiedToUserform HidingForms InlineSearchDoesNotWork RegistrationUserFormDisconnect RegistrationVariablesIntoUserTopic SlowTwiki TableInclude WebStatistics

looks ok to me....?

-- CrawfordCurrie - 19 Sep 2006

Does one of your form fields contain newlines? That would break a CALC apart and you would see an unresolved formula.

-- PeterThoeny - 19 Sep 2006

Yes, I thought of that as I was falling asleep last night - and it is a carriage return that's breaking the CALC... I had the same problem before, but then I was drawing data into the CALC from a URLPARAM and resolved it by adding a newline="<br />". Is there a way to to do the same for formfields? I tried adding a newline="<br />" to the URLPARAM that gets the data into the TWikiForm, but it doesn't work...

-- CarlMcKinney - 19 Sep 2006

The newline="%BR%" as a SEARCH parameter should work. Note that this parameter exists in TWiki 4, but was documented just in a recent patch release. See VarSEARCH.

-- PeterThoeny - 19 Sep 2006

Works like a charm! Thanks so much!

-- CarlMcKinney - 21 Sep 2006

Thanks, this had me confused for a while. A user had added a carriage return to a form field, which was formatted as %0d%0a in hexadecimal, which was causing problems within the SEARCH command.

Are there any other form inputs that are reformatted in a way which could cause similar problems?

-- AlistairRevell - 07 Oct 2007

Yeah - SEARCH does a simple grep, and in the plain files a couple of characters is being escaped to avoid confusion for TWiki's parser:

Character newline carriage return " % { }
SEARCH as %0a %0d %22 %25 %7b %7d

-- HaraldJoerg - 08 Oct 2007

Change status to:
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2007-10-08 - HaraldJoerg
 
  • 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.