[dokuwiki] Why can't I change the query in SEARCH_QUERY_FULLPAGE?

  • From: Chris G <cl@xxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 30 Jun 2011 00:12:24 +0100

I have an action plugin catching the SEARCH_QUERY_FULLPAGE event,
however although I am using 'BEFORE' it doesn't seem to be possible to
change the query string passed to _ft_pageSearch().

The code is pretty trivial:-

    class action_plugin_searchform extends DokuWiki_Action_Plugin
    {
        /**
         * register the eventhandlers and initialize some options
         */
        function register(&$controller)
        {
            $controller->register_hook('SEARCH_QUERY_FULLPAGE',
                                       'BEFORE',
                                       $this,
                                       'handle_search',
                                       array());

        }
        //
        //
        // Handle action, don't output error, allow TPL_ACT_UNKNOWN to catch it
        //
        function handle_search(&$event, $param)
        {
            $event->data['query'] = "New value for query";
        }
    }


The query stays resolutely unchanged.  What am I doing wrong?  Or is it
not possible to change the query via this event?

-- 
Chris Green
-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: