-
-
Notifications
You must be signed in to change notification settings - Fork 247
Description
Setup
- SMW version: 6.0.1
- MW version: 1.45.0-beta
- PHP version: 8.2.27 (fpm-fcgi
- DB system (MySQL, Blazegraph, etc.) and version: 10.5.28-MariaDB-log
Issue
Detailed description of the issue and a stack trace if applicable:
Vergleichsweise bei bei Aufruf der Wikiseite "Permamenter Link":
/mediawiki/index.php?title=Gespr%C3%A4ch:Wikipedia_Modul:Vorlage:lang_Link-Erweiterung&oldid=150488 Error: Call to undefined method MediaWiki\Parser\ParserOutput::getText()
Ursache
Ursache: In MediaWiki 1.45 wurde ParserOutput::getText() entfernt (seit 1.42 deprecatet). Dein SMW 6.0.1 ruft diese Methode in OutputPageParserOutput auf → Fatalfehler beim Permalink (oldid).
MediaWiki
+1
Kompatibilität: SMW 6.0.1 ist offiziell nur für MW 1.43–1.44 freigegeben. Mit 1.45 kollidiert es u. a. genau wegen des entfernten getText()
Patches
### 1. Patch OutputPageParserOutput.php
extensions/SemanticMediaWiki/src/MediaWiki/Hooks/OutputPageParserOutput.php
alt
$text = $parserOutput->getText();
neu (MW-1.45-sicher und abwärtskompatibel)
$text = method_exists( $parserOutput, 'getRawText' )
? $parserOutput->getRawText()
: ( method_exists( $parserOutput, 'getText' ) ? $parserOutput->getText() : '' );
### 2.) RecursiveTextProcessor.php
extensions/SemanticMediaWiki/src/Parser/RecursiveTextProcessor.php
alt
$text = $parserOutput->getText( [ 'enableSectionEditLinks' => false ] );
neu
$text = method_exists( $parserOutput, 'getRawText' )
? $parserOutput->getRawText()
: $parserOutput->getText( [ 'enableSectionEditLinks' => false ] ); // MW < 1.45
### 3.) CachedFactbox.php
extensions/SemanticMediaWiki/src/Factbox/CachedFactbox.php
Block 1 – Inhalt (nach parse( $content, false ))
ersetzen
$content = InTextAnnotationParser::removeAnnotation(
$contentParser->getOutput()->getText()
);
durch
$content = InTextAnnotationParser::removeAnnotation(
method_exists( $contentParser->getOutput(), 'getRawText' )
? $contentParser->getOutput()->getRawText()
: $contentParser->getOutput()->getText()
);
Block 2 – Attachment (nach parse( $attachmentContent, false ))
ersetzen
$attachmentContent = $contentParser->getOutput()->getText();
durch
$attachmentContent = method_exists( $contentParser->getOutput(), 'getRawText' )
? $contentParser->getOutput()->getRawText()
: $contentParser->getOutput()->getText();
### 4.) LingoParser.php
extensions/SemanticMediaWiki/src/LingoParser.php
Block – Zuweisung von $text
ersetzen
$text = $params === null ? $parser->getOutput()->getText() : $parser->getOutput()->getText( [
'allowTOC' => !$params['disabletoc'],
'enableSectionEditLinks' => !$params['disableeditsection'],
'wrapperDivClass' => $params['wrapoutputclass'],
'deduplicateStyles' => !$params['disablestylededuplication'],
] );
durch
$text = method_exists( $parser->getOutput(), 'getRawText' )
? $parser->getOutput()->getRawText()
: ( $params === null
? $parser->getOutput()->getText()
: $parser->getOutput()->getText( [
'allowTOC' => !$params['disabletoc'],
'enableSectionEditLinks' => !$params['disableeditsection'],
'wrapperDivClass' => $params['wrapoutputclass'],
'deduplicateStyles' => !$params['disablestylededuplication'],
] )
);
Prüfabfrage welche php-Dateien gegebenenfalls noch zu patchen sind:
grep -R -n -E --include='*.php' -- '$parserOutput->getText(|->getOutput()->getText('
/path-to-mediawiki-installation-folder/extensions
| grep -v '/tests/'
Weiter Maßnahmen zur Fehlerbehebung
page reload after applied all patches