Page MenuHomePhabricator

MediaWiki preloading query parameter do not allow to preload from i18n messages
Closed, ResolvedPublic

Description

MediaWiki supports creating pages with preloaded text. This is implemented using the following query parameters:

  • preloadtitle: when adding a new section via action=edit&section=new, it preloads the title of the message
  • preload: preloads the contents of the textbox with a wikitext that comes from a certain on-wiki page

The preload query parameter, however, fails to read content of a system message. This makes it harder to make use of preloading from a MediaWiki extension, where content can be provided through an i18n message (and community can easily customize it as needed by making an on-wiki edit).

EditPage class checks for Title::exists, while for this use-case, calling either Title::hasSourceText or Title::isKnown sounds more reasonable. Switching would require changing WikiPage::getContent to something that can get texts of both system messages and database-recorded pages.

Event Timeline

Change 912352 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/core@master] EditPage: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/912352

Urbanecm_WMF added a project: User-notice.
Urbanecm_WMF moved this task from To Triage to Not ready to announce on the User-notice board.

Change 912891 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/912891

Change 912352 merged by jenkins-bot:

[mediawiki/core@master] EditPage: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/912352

Change 912891 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/912891

Change 914302 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/core@wmf/1.41.0-wmf.6] EditPage: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/914302

Change 914303 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/VisualEditor@wmf/1.41.0-wmf.6] ApiVisualEditor: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/914303

Change 914304 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/core@wmf/1.41.0-wmf.7] EditPage: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/914304

Change 914305 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/VisualEditor@wmf/1.41.0-wmf.7] ApiVisualEditor: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/914305

The change will be deployed to all projects on 2023-05-04 the latest. Impact: URLs like https://cs.wikipedia.org/wiki/User_talk:Martin_Urbanec_(WMF)?action=edit&section=new&preload=MediaWiki:July will work (and preload the content of the July message).

Change 914302 merged by jenkins-bot:

[mediawiki/core@wmf/1.41.0-wmf.6] EditPage: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/914302

Change 914303 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@wmf/1.41.0-wmf.6] ApiVisualEditor: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/914303

Change 914304 merged by jenkins-bot:

[mediawiki/core@wmf/1.41.0-wmf.7] EditPage: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/914304

Mentioned in SAL (#wikimedia-operations) [2023-05-04T07:29:57Z] <urbanecm@deploy1002> Started scap: Backport for [[gerrit:914836|Mentor dashboard: Move away from alpha/beta/stable (T334630)]], [[gerrit:914302|EditPage: Support preloading from i18n messages (T330337)]], [[gerrit:914303|ApiVisualEditor: Support preloading from i18n messages (T330337)]], [[gerrit:914304|EditPage: Support preloading from i18n messages (T330337)]]

Mentioned in SAL (#wikimedia-operations) [2023-05-04T07:31:28Z] <urbanecm@deploy1002> urbanecm: Backport for [[gerrit:914836|Mentor dashboard: Move away from alpha/beta/stable (T334630)]], [[gerrit:914302|EditPage: Support preloading from i18n messages (T330337)]], [[gerrit:914303|ApiVisualEditor: Support preloading from i18n messages (T330337)]], [[gerrit:914304|EditPage: Support preloading from i18n messages (T330337)]] synced to the testservers: mwdebug2002.codfw.wmnet, mwdebug2

Mentioned in SAL (#wikimedia-operations) [2023-05-04T07:37:55Z] <urbanecm@deploy1002> Finished scap: Backport for [[gerrit:914836|Mentor dashboard: Move away from alpha/beta/stable (T334630)]], [[gerrit:914302|EditPage: Support preloading from i18n messages (T330337)]], [[gerrit:914303|ApiVisualEditor: Support preloading from i18n messages (T330337)]], [[gerrit:914304|EditPage: Support preloading from i18n messages (T330337)]] (duration: 07m 58s)

Change 914305 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@wmf/1.41.0-wmf.7] ApiVisualEditor: Support preloading from i18n messages

https://gerrit.wikimedia.org/r/914305

Mentioned in SAL (#wikimedia-operations) [2023-05-04T07:49:15Z] <urbanecm@deploy1002> Started scap: Backport for [[gerrit:914305|ApiVisualEditor: Support preloading from i18n messages (T330337)]], [[gerrit:914837|Mentor dashboard: Move away from alpha/beta/stable (T334630)]]

Mentioned in SAL (#wikimedia-operations) [2023-05-04T07:50:50Z] <urbanecm@deploy1002> urbanecm: Backport for [[gerrit:914305|ApiVisualEditor: Support preloading from i18n messages (T330337)]], [[gerrit:914837|Mentor dashboard: Move away from alpha/beta/stable (T334630)]] synced to the testservers: mwdebug1002.eqiad.wmnet, mwdebug2002.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2001.codfw.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-05-04T07:56:24Z] <urbanecm@deploy1002> Finished scap: Backport for [[gerrit:914305|ApiVisualEditor: Support preloading from i18n messages (T330337)]], [[gerrit:914837|Mentor dashboard: Move away from alpha/beta/stable (T334630)]] (duration: 07m 08s)

The change will be deployed to all projects on 2023-05-04 the latest. Impact: URLs like https://cs.wikipedia.org/wiki/User_talk:Martin_Urbanec_(WMF)?action=edit&section=new&preload=MediaWiki:July will work (and preload the content of the July message).

This feature is now available on the Wikimedia sites.