The docs of WikiPage::prepareContentForEdit say:
@deprecated since 1.32, use getDerivedDataUpdater instead
But WikiPage::getDerivedDataUpdater is private, and so has been since its introduction in r405015. What should we use as replacement?
The docs of WikiPage::prepareContentForEdit say:
@deprecated since 1.32, use getDerivedDataUpdater instead
But WikiPage::getDerivedDataUpdater is private, and so has been since its introduction in r405015. What should we use as replacement?
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Introduced PreparedUpdate to replace PreparedEdit | mediawiki/core | master | +341 -43 | |
Use WikiPage::getCurrentUpdate | mediawiki/extensions/SpamBlacklist | master | +2 -3 |
{{ping}} This method was deprecated 3 versions ago and it still doesn't have a documented replacement.
Change 701074 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):
[mediawiki/core@master] WIP: introduced PreparedUpdate to replace PreparedEdit
This was stalled for a long time, since I was hoping to avoid WikiPage maintaining state about ongoing edits. That would however mean replacing several hooks that are fired during edits with a new version that would expose the relevant state directly. We never got around to scheduling that effort.
My proposal for now is to continue the pattern set by PreparedEdit and WikiPage::prepareContentFor edit, by introducing PreparedUpdate and WikiPage::prepareUpdate(). The PreparedUpdate interface seems find for the future. Access to WikiPage::prepareUpdate() should eventually become unnecessary when we have better hooks.
I made a WIP patch to explore the idea. Comments on the approach I took are very welcome.
Pinging @Addshore since we discussed this in the context of Wikibase recently, in particular the need to defer rendering until after the response has been sent.
Besides AbuseFilter, other extensions affected are TemplateData, SpamBlacklist, MediaWiki-extensions-FlaggedRevs, and ConfirmEdit (CAPTCHA extension).
Change 705854 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):
[mediawiki/extensions/SpamBlacklist@master] Use WikiPage::getCurrentUpdate
Please comment at T288639 if you disagree. Copying here for awareness.
The prepareContentForEdit signature is very close to what the new proposed thing looks like. And re-adopting that first will be an easy way to re-centralise the call structure, as well as to validate out hypothesis with regards to save timing regression.
Ideally, extensions would get a PreparedUpdate as a hook parameter. Until we have that, we can expose the "current" PreparedUpdate via a service. This is better than relying on a WikiPage instance coming from RequestContext (especially since we want to kill RequestContext::getWikiPage).
Change 705854 abandoned by Daniel Kinzler:
[mediawiki/extensions/SpamBlacklist@master] Use WikiPage::getCurrentUpdate
Reason:
Change 701074 merged by jenkins-bot:
[mediawiki/core@master] Introduced PreparedUpdate to replace PreparedEdit