• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4784: SEARCH result has an extra separator at the end

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal Confirmed   minor  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

I wanted to make a search such that I could use the result in a regular expression, so I selected the separator |. Here's what happened:

%SEARCH{"Etruscan Art" format="$topic" separator="|"}% : Search: Etruscan Art

Item4784|

Number of topics: 1

As you can see, there is an extra | at the end of the list, which makes the RE unusable. The separator should separate the search terms, it shouldn't also terminate the list.

-- TWiki:Main/CrawfordCurrie - 08 Oct 2007

First result of debugging: There are at least two bugs.

  1. The code tries to remove the final separator around Search.pm line 1023, but at this place the summary "Number of topics" is already in place.
  2. Using nototal="on" doesn't help at all, of course, because the separator has a meaning in a regex (try separator="*" for a more disastrous example of this error). The second bug needs to be fixed by enclosing the regexp with \Q$separator\E$, for the first it is now too late.

-- TWiki:Main.HaraldJoerg - 08 Oct 2007


It emerges that it's due to the way the list of results is built. There is code to remove the trailing separator from the list (this is a really bad way to build a list, but oh what the hell)

Solution was to quotemeta the string used in the replacement RE, which was the second of Harald's suggestions and seems to fix it.

CC


Not yet "Waiting for Release"! It doesn't work unless you set nototal="on"!

It could be lowered to "Normal", though, because it is unlikely that a formatting application can do with the "Number of topics" string, but not with a trailing separator.

-- TWiki:Main.HaraldJoerg - 08 Oct 2007

OK, sorry, I didn't understand your report before. Lowered to Normal.

CC

This item has targetrelease minor (which is getting closer), but no waiting for?

-- TWiki:Main.SteffenPoulsen - 22 Dec 2007

ItemTemplate
Summary SEARCH result has an extra separator at the end
ReportedBy TWiki:Main.CrawfordCurrie
Codebase

SVN Range TWiki-4.3.0, Sat, 06 Oct 2007, build 15172
AppliesTo Engine
Component

Priority Normal
CurrentState Confirmed
WaitingFor

Checkins TWikirev:15210 TWikirev:15211
TargetRelease minor
ReleasedIn

Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2007-12-22 - SteffenPoulsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback