Hello Support.
I have written an extension which loads a Latex preamble, adds contents from Wiki page section and generates and displays the Latex compilation result. It has been working for many years. Now I need to make the preamble editable and I miserably fail.
The working code looks as follows:
$templateFileName = TEMPLATE_PATH."amstex1.tex";
$template = file_get_contents( $templateFileName);
self::debugLog ("have template file \n");
What I now want to do instead is this:
// attempt to get template from mediawiki itself
self::debugLog (" Will now load from mediawiki itself \n");
try {
$myTitle = Title::newFromTextThrow( 'MediaWiki:AmstexTemplate' );
if ($myTitle->canExist) {self::debugLog ("can exist");}
else {self::debugLog("not existing");}
$myArticle = new Article( $myTitle );
$template = $myArticle->getPage()->getContent()->getNativeData();
self::debugLog ("Done");
} catch (Exception $e) { self::debugLog ("In generateTex exception handler"); }
self::debugLog ("Loaded template");
My problem is: It looks like the system vanishes into Nirwana in the Title::newFromTextThrow call. I get no debug information, no exception, just nothing. So I also fail to debug this.
What can I do?