Tags:
create new tag
, view all tags

Enhancement request:

Search::searchWeb has too many (21) positional parameters; should use keywords.

Enter description here

As I am chasing down a bug with TreePlugin, I encountered Search::searchWeb, which has 21 positional parameters.

I think this may be the cause of the bug I am searching for; not sure yet.

But, that doesn't matter: 21 positional parameters is just plain lousy code, asking for a problem. I.e. it is a code smell. It should be changed to use Perl-style keyword parameters.

-- AndyGlew - 19 Jun 2003

Changed from BugReport to FeatureEnhancementRequest

-- PeterThoeny - 01 Jul 2003

The lib/TWiki/Search.pm script accepts now named parameters, e.g. a hash of key/value pairs. Dependent files bin/search and lib/TWiki.pm are updated. (This is part of working on SearchTopicNameAndTopicText, ExcludeWebTopicsFromSearch, SearchWithNoPipe, ArgumentListIsTooLongForSearch, InlineSearchArgListTooLong, SiteMapIsSlow)

Note to Plugin developers: In case you are using the undocumented Search::searchWeb function you need to update your Plugin. Hint: This here is portable:

my $search = "%SEARCH{ whatever search string and parameters you need }%";
my $result = TWiki::Func::expandCommonVariables( $search, $topic, $web );

-- PeterThoeny - 01 Nov 2003

Topic revision: r15 - 2003-12-17 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.