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

Edit | Attach | Watch | Print version | History: r15 < r14 < r13 < r12 < r11 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r15 - 2003-12-17 - PeterThoeny
  • 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-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.