[dokuwiki] Re: Location of the INDEXER_PAGE_ADD => AFTER event

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sun, 4 Mar 2012 18:15:25 +0100

Hi,

> I have a question about the location of the INDEXER_PAGE_ADD => AFTER 
> event.  The subjectindex plugin tries to hook into the indexer via
> this event to allow its own index entries to be updated when a wiki
> page is updated (during a full index rebuild for example).
> 
> However the plugin needs access to the new page id ('pid') in order
> to do this.  Would it be possible to move the event's trigger
> location as shown below, which would really be AFTER the page has
> been indexed?  Any repercussions?

Yeah I think that makes sense. I'm also wondering why the event doesn't
pass the page body to the handler in the before event but instead
prepends the plugin body to the page content later. Would make more
sense to give plugins the ability to rewrite the data that will be
indexed.

The after event then should pass the PID in the event data as well.

Can you fork the repo and send a pull request with the according
changes?

Andi


-- 
Dipl. Inf. Andreas Gohr (FH) / software & technologies
__ CosmoCode GmbH - http://www.cosmocode.de
__ Prenzlauer Allee 36, 10405 Berlin, Germany
__ Tel +49-30-814504083, Fax +49-30-28097093
__
__ Geschaeftsfuehrung (CEO): D. Huettemann, J. Riebesell
__ Amtsgericht Berlin-Charlottenburg; HRB 74063
-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: