Skip to content

Commit

Permalink
Fix for VusualEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
pastakhov committed Mar 6, 2024
1 parent cbb1377 commit bea8bb0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/SemanticMW/QueryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,13 @@ private function getTitleOutput( string $titleText ) {
}

private function getParser(): \Parser {
return MediaWikiServices::getInstance()->getParser();
$user = \RequestContext::getMain()->getUser();
$parser = MediaWikiServices::getInstance()->getParser();
if ( !$parser->getOptions() ) {
$parser->setOptions( new \ParserOptions( $user ) );
}
$parser->clearState();
return $parser;
}

/**
Expand Down

0 comments on commit bea8bb0

Please sign in to comment.