Item9281: Topic names containing regex characters break parent section of more.tmpl

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component:
Branches:
Reported By: GeorgeClark
Waiting For:
Last Change By: KennethLavrsen
The more.tmpl searches for topic parent using a regex type search.

%SEARCH{ "^%TOPIC%$" casesensitive="on" scope="topic" regex="on" nosearch="on" nototal="on" format="$parent" }%

Changing the more.tmpl to search for the named topic directly resolves the problem. But I'm not sure what the wider impact of this will be.

%SEARCH{ ".*" topic="%TOPIC%" casesensitive="on" scope="topic" regex="on" nosearch="on" nototal="on" format="$parent" }%

I suspect that including %TOPIC% in the regex patter would fail for a topic name containing any Regex meta characters. Another solution would be to include all Regex characters in the NameFilter, but this would create issues for existing sites.

Lavr, Can you try this change on your system? Fix checked in. Please test. I can't recreate the exact issue that you've encountered, but this does work on my system. Here is the original error you reported:

Current parent:
IF{ "'NONE Could not perform search. Error was: Nested quantifiers in regex; marked by <-- HERE in m/^MyC++ <-- HERE $/ 
at /var/www/foswiki/core/lib/Foswiki/Store/SearchAlgorithms/Forking.pm line 239. 
at /var/www/foswiki/core/lib/Foswiki/Store/SearchAlgorithms/Forking.pm line 239 Foswiki::Store::SearchAlgorithms::Forking::_webQuery('Foswiki::Search::Node=HASH(0x8dafd10)', 'Myweb', 'undef', 'Foswiki=HASH(0x890f088)', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Store/SearchAlgorithms/Forking.pm line 173 Foswiki::Store::SearchAlgorithms::Forking::query('Foswiki::Search::Node=HASH(0x8dafd10)', 'undef', 'Foswiki=HASH(0x890f088)', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Store/VC/Store.pm line 480 Foswiki::Store::VC::Store::query('Foswiki::Store::RcsWrap=HASH(0x8923094)', 'Foswiki::Search::Node=HASH(0x8dafd10)', 'undef', 'Foswiki=HASH(0x890f088)', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Meta.pm line 623 Foswiki::Meta::query('Foswiki::Search::Node=HASH(0x8dafd10)', 'undef', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Search.pm line 349 Foswiki::Search::searchWeb('Foswiki::Search=HASH(0x91f1788)', 'casesensitive', 'on', 'search', '^MyC++$', 'basetopic', 'MyC++', '_RAW', ' " }: Syntax error in ''NONE Could not perform search. Error was: Nested quantifiers in regex; marked by <-- HERE in m/^MyC++ <-- HERE $/ 
at /var/www/foswiki/core/lib/Foswiki/Store/SearchAlgorithms/Forking.pm line 239. 
at /var/www/foswiki/core/lib/Foswiki/Store/SearchAlgorithms/Forking.pm line 239 Foswiki::Store::SearchAlgorithms::Forking::_webQuery('Foswiki::Search::Node=HASH(0x8dafd10)', 'Myweb', 'undef', 'Foswiki=HASH(0x890f088)', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Store/SearchAlgorithms/Forking.pm line 173 Foswiki::Store::SearchAlgorithms::Forking::query('Foswiki::Search::Node=HASH(0x8dafd10)', 'undef', 'Foswiki=HASH(0x890f088)', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Store/VC/Store.pm line 480 Foswiki::Store::VC::Store::query('Foswiki::Store::RcsWrap=HASH(0x8923094)', 'Foswiki::Search::Node=HASH(0x8dafd10)', 'undef', 'Foswiki=HASH(0x890f088)', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Meta.pm line 623 Foswiki::Meta::query('Foswiki::Search::Node=HASH(0x8dafd10)', 'undef', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Search.pm line 349 Foswiki::Search::searchWeb('Foswiki::Search=HASH(0x91f1788)', 'casesensitive', 'on', 'search', '^MyC++$', 'basetopic', 'MyC++', '_RAW', ' ' 
at ''> Could not perform search. Error was: Nested quantifiers in regex; marked by <-- HERE in m/^MyC++ <-- HERE $/ 
at /var/www/foswiki/core/lib/Foswiki/Store/SearchAlgorithms/Forking.pm line 239. 
at /var/www/foswiki/core/lib/Foswiki/Store/SearchAlgorithms/Forking.pm line 239 Foswiki::Store::SearchAlgorithms::Forking::_webQuery('Foswiki::Search::Node=HASH(0x8dafd10)', 'Myweb', 'undef', 'Foswiki=HASH(0x890f088)', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Store/SearchAlgorithms/Forking.pm line 173 Foswiki::Store::SearchAlgorithms::Forking::query('Foswiki::Search::Node=HASH(0x8dafd10)', 'undef', 'Foswiki=HASH(0x890f088)', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Store/VC/Store.pm line 480 Foswiki::Store::VC::Store::query('Foswiki::Store::RcsWrap=HASH(0x8923094)', 'Foswiki::Search::Node=HASH(0x8dafd10)', 'undef', 'Foswiki=HASH(0x890f088)', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Meta.pm line 623 Foswiki::Meta::query('Foswiki::Search::Node=HASH(0x8dafd10)', 'undef', 'HASH(0x9295f68)') 
called at /var/www/foswiki/core/lib/Foswiki/Search.pm line 349 Foswiki::Search::searchWeb('Foswiki::Search=HASH(0x91f1788)', 'casesensitive', 'on', 'search', '^MyC++$', 'basetopic', 'MyC++', '_RAW', ' ' 

-- GeorgeClark - 08 Jul 2010

pharvey suggested using %META{"parent" dontrecurse="on"}% - that works too. Will check in the fix.

-- GeorgeClark - 09 Jul 2010
 

ItemTemplate edit

Summary Topic names containing regex characters break parent section of more.tmpl
ReportedBy GeorgeClark
Codebase trunk
SVN Range
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:7fb57328be5c
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r6 - 04 Oct 2010, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy