On Tue, Nov 20, 2012 at 3:27 PM, Pablo Nuñez <pablonuniez(a)gmail.com> wrote:
Hi, we are trying to invoke a ParserFunction we define
in our wiki. That
function invoke another that makes changes in some pages of the wiki. The
problem is that every ParserFunction executes twice.
That's a little strange, because sometimes it executes twice and others
once. It occurs with every ParserFunction.
Is it something normal or we could configure to execute once?
Sounds like the page is being parsed twice -- which is not atypical on
edit. You might get one parse for the default global settings, parser
cache, and link tables, and then another parse for the current user if
their settings differ.
In general, you should assume that parsing is idempotent -- the same
actions should happen and the same result should be returned every time you
call with the same input. Otherwise you may run into trouble with things
not expected what you're doing.
-- brion