Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Fix CI: ParserOutput::getText() is undefined on MW 1.44; use a version-agnostic accessor
MW 1.44 removed/renamed ParserOutput::getText(), causing the CI failure. Use feature detection to support both older and newer MW versions.
Apply this diff to return HTML in a cross-version way:
Run this quick check to ensure there are no other getText() calls on ParserOutput in the codebase:
If you want me to narrow down the exact MW 1.44 replacement (getHtml vs getRawText) from upstream docs and update the patch accordingly, I can do that as well:
🏁 Script executed:
Length of output: 460
🌐 Web query:
💡 Result:
In MediaWiki 1.44, the correct method to retrieve the HTML string from a ParserOutput object is
getHtml(). This replaces the deprecatedParserOutput::getText()method.<mw:editsection>markers and other non-final elements, not suitable for direct display to users; its return type is string[3].Details:
getText()was commonly used to get HTML, but this method has been deprecated and removed in MediaWiki 1.44[3].getHtml(), is now the standard approach for retrieving sanitized, ready-to-display HTML from a ParserOutput instance[2].getRawText()is primarily for internal use or caching, as it retains edit section markers and other metadata not intended for user viewing[3].Summary Table:
getHtml()getRawText()getText()Always use
getHtml()to obtain the user-facing HTML in MediaWiki 1.44[2][3]. If you need the raw parser output (cacheable, with internal markers), usegetRawText()[3].Citations:
🏁 Script executed:
Length of output: 3219
🏁 Script executed:
Length of output: 421
Fix CI: replace removed ParserOutput::getText() with a version-agnostic accessor (prefer getHtml)
MediaWiki 1.44 removed ParserOutput::getText(), causing CI failures. Replace direct ->getText() calls on ParserOutput with feature-detection that prefers getHtml(), falls back to getText() on older MW, and uses getRawText() only as a last resort.
Files that need changes (from repo scan):
Apply this pattern (example diff for TestFactory.php):
Notes:
📝 Committable suggestion
🧰 Tools
🪛 GitHub Actions: CI
[error] 31-31: Command 'php tests/phpunit/phpunit.php -c extensions/Maps' failed: Call to undefined method MediaWiki\Parser\ParserOutput::getText()
🤖 Prompt for AI Agents