Greetings,

I've got a simple Extension that expands an {{#include}} parser function
into random text.  It works well for most things, but if I try to stick in
a new heading, includes/Preprocessor_DOM.php::expand() fails on this...

  $titleText = $this->title->getPrefixedDBkey();

because "$this" (a PPFrame_DOM) does not have a title object.  As a
temporary band-aid, I inserted this into Preprocessor_DOM.php:

  if(! $this->title) $this->title = Title::newFromText("XXX");

But is there a way to fix this from within the extension?  Code attached,
it's pretty trivial.

While I'm at it, for extra credit, is there a way to determine the
equivalent of expand's $expansionDepth (== how deep in the transclusions
we are) from within an extension?

Cheers,
-jani
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to