Repository navigation
Validate the config page with JsonValidateSave and track maps on SMW's parser - #949
Merged
Merged
Conversation
JeroenDeDauw
force-pushed
the
fix/editfilter-hook-and-parser-getoutput
branch
2 times, most recently
from
October 3, 2026 00:17
62e56a6 to
81cfb2c
Compare
JeroenDeDauw
force-pushed
the
fix/editfilter-hook-and-parser-getoutput
branch
from
October 3, 2026 02:27
81cfb2c to
b826a8b
Compare
MediaWiki 1.46 deprecates the `EditFilter` hook, and Maps registers it during setup, so every request logs a deprecation warning. MediaWiki master (1.47) no longer runs it, so the `MediaWiki:Maps` config page accepts invalid configuration there. `JsonValidateSave` has the same interface from 1.43 through master and runs on every save of JSON content through `PageUpdater`, so the config is now also validated on saves without the edit form, such as with `edit.php` or a rollback. Each validation error goes on the save status as its own message; the `maps-config-invalid` heading message is gone. The edit API fails with the first error instead of `hookaborted`. Core escapes the error parameters when it shows them on 1.43 to 1.46, so escaping them here too would show them escaped twice. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With `$egMapsEnableCategory` enabled, `MapPrinter` read the main parser's output to decide whether to add the tracking category. When the main parser had not parsed anything yet, as on Special:Ask or when Parsoid renders the page, that logged a deprecation warning on MediaWiki 1.43 to 1.45 and was a fatal error on 1.46 and later. After an earlier parse, the category went to that parse's output and was lost. The category is now added only for inline queries, to the parser that SMW runs the query with, which `ResultPrinter::copyParser()` returns rather than a copy. For `#ask` and `#show`, SMW binds it to the parser running the parser function, Parsoid's included, so map queries that Parsoid renders now get the category too. Other callers, such as Semantic Compound Queries, get whichever parser SMW last held: if it has not parsed anything, the category is skipped; if it is idle after an earlier query, the category goes to that query's output and is lost. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
JeroenDeDauw
force-pushed
the
fix/editfilter-hook-and-parser-getoutput
branch
from
October 3, 2026 17:31
b826a8b to
b1a75fc
Compare
JeroenDeDauw
marked this pull request as ready for review
October 3, 2026 18:42
JeroenDeDauw
added a commit
that referenced
this pull request
Oct 3, 2026
…namespace check (#950) Follows-up to #949 `ConfigPageHooksTest` saves `MediaWiki:Maps` on the wiki's real database, so a failing run left the invalid test config as the wiki's live configuration. A save that goes through is now undone before the assertions run. The test for other JSON pages changed namespace and title at once, so dropping the namespace half of the config-page check went unnoticed. It now uses a page named `Maps` in the GeoJson namespace. `MapPrinter` imports `MapsFactory`, and its tracking-category comment no longer claims for every caller what only holds for `#ask` and `#show`. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follows-up to #948
MediaWiki 1.46 deprecates the
EditFilterhook, and Maps registers it during setup, so every request logs a deprecationwarning. MediaWiki master (1.47) no longer runs it, so the
MediaWiki:Mapsconfig page accepts invalid configurationthere, contrary to the 15.0.0 release note. Validation now uses
JsonValidateSave, whose interface is the same from1.43 through master. Core runs it on every save of JSON content through
PageUpdater, such as byedit.phpor arollback, and on undeletion. Each validation error is its own fatal message and the
maps-config-invalidheading isgone, so the edit API's default error format reports the first validation error instead of
hookaborted. On 1.43 to1.46 the edit form lists the errors in one box and core escapes their parameters; master's edit form parses error
parameters as wikitext, for every extension.
With
$egMapsEnableCategoryenabled, the map result format read the main parser's output to decide whether to add thetracking category. When the main parser had not parsed anything yet, as on Special:Ask or when Parsoid renders the page,
that logged a deprecation warning on 1.43 to 1.45 and was a fatal error on 1.46 and master; after an earlier parse, the
category went to that parse's output and was lost. The category is now added only for inline queries, to the parser that
SMW runs the query with, once that parser has parsed something. For
#askand#showthat is the parser running theparser function. So pages that Parsoid renders, as master's RefreshLinksJob does by default, now get the category, and
so do pages whose wikitext another extension, such as NativeMarkdown, parses on its own parser. Semantic Compound
Queries and other callers get whichever parser SMW last held, which can be idle after an earlier query; the category
then goes to that query's output and is lost.
Considered, omitted:
EditFilterMergedContent: core runs it only for the edit form and API, content model changes and MCR undoMediaWiki:Maps(MovePageIsValidMove) and imports (no hook): Maps ignores invalid valueswhen it reads the page
getParserClone()): the clone runs a parse of its own, so it does not hit thiserror; it only resolves popup links against an unrelated page
coordinates