Commit graph

189 commits

Author SHA1 Message Date
libraryupgrader 1baeb9ef0c build: Updating composer dependencies
* mediawiki/minus-x: 0.3.2 → 1.0.0
* mediawiki/mediawiki-phan-config: 0.9.0 → 0.9.1

Change-Id: Ibf55f382c586603967da0086f86bfe4924e7cf96
2020-01-26 18:27:39 +00:00
jenkins-bot 523e9379c2 Merge "ApiVisualEditor.php: Add notices also when not blocked" 2020-01-16 23:29:36 +00:00
Umherirrender a7497703a7 Fix new documentation sniffs
Change-Id: If9fc2d1d29aefdcb61a5f69c28f7d50c86b3ac4a
2020-01-10 16:28:16 -08:00
libraryupgrader 6afa14fe4d build: Updating mediawiki/mediawiki-codesniffer to 29.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag

Change-Id: If59d450236a7d1afa3c6a05536abea819535f984
2020-01-10 17:51:43 +00:00
James D. Forrester 2c77e88d2c doc: Bump copyright year for 2020
Change-Id: I30539877543dc2a57bd1428a00d10ac46d8fc294
2020-01-08 09:13:24 -08:00
jenkins-bot 3e3a84f9b6 Merge "Fix 2017WTE change tag for edits that blank the page" 2020-01-06 18:30:29 +00:00
lens0021 a01f28c8a3
ApiVisualEditor.php: Add notices also when not blocked
Bug: T241693
Change-Id: I2c4355f7a2398b742d635f1de0cf87d4ec527cb3
2020-01-06 17:41:17 +09:00
Bartosz Dziewoński 54f2ba68d7 Fix 2017WTE change tag for edits that blank the page
Bug: T241797
Change-Id: I5c843f7ebcffba720f3dd0564947c197a76cf82e
2020-01-03 08:49:44 +01:00
Ed Sanders 21b676452e Fix Special: title in ApiVisualEditorEdit
We also do this in ApiVisualEditor.

Change-Id: I5c27c6e7770d0a5093684cadeaf1786f85dc32ff
2019-12-20 15:50:48 +00:00
jenkins-bot 0d0ef6071f Merge "Remove an unused piece of code from ApiVisualEditor" 2019-12-18 10:30:22 +00:00
Thiemo Kreuz 8e4dc67ec7 Fix unchecked array access in ApiVisualEditor
I'm not sure if this qualifies as an actual fix. I don't really know
what this code is supposed to do. Maybe the bad array access is a hint
for a completely different error somewhere else. All this patch really
does is silencing the bad array access.

This line of code was introduced with I1b35b28 in May already. Why does
it start failing now?

Bug: T240961
Change-Id: I5ec2dc453e5d8db5d2f9e49058eda001ed021d3d
2019-12-18 08:22:25 +01:00
Thiemo Kreuz 0f4918e3e3 Remove an unused piece of code from ApiVisualEditor
Change-Id: I5ca2ad9df0decfada199d44366de8efc9f2b26ac
2019-12-18 08:17:01 +01:00
libraryupgrader c8de97fcd2 build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Change-Id: Iaaea284190aa9306177b3ee945a75da631a89b93
2019-12-16 10:11:47 +00:00
jenkins-bot af700cd536 Merge "ApiVisualEditorEdit: Normalize newlines in wikitext" 2019-12-13 15:42:50 +00:00
Bartosz Dziewoński 9779336403 ApiVisualEditorEdit: Simplify diff handling a bit more!
Dealing with `result: 'nochanges'` is annoying. Just return an empty
diff to indicate no changes.

Change-Id: I192caa67ec85224500a6919efd370cf7b5c1c592
2019-11-24 09:51:54 +00:00
Bartosz Dziewoński 1e890f975f ApiVisualEditorEdit: Simplify diff handling a bit
I'm trying to track down possible values of 'result' for client-side
error handling and this was confusing.

Change-Id: I325249f7c57936c9c11a1d3dc9166b1ca3737c39
2019-11-18 15:57:36 -05:00
Bartosz Dziewoński a4d7c41e68 ApiVisualEditorEdit: Normalize newlines in wikitext
Firefox apparently sends us \r\n newlines, even though we use \n.

Bug: T154977
Change-Id: I22e9a2e11c63ab62b6e37c86455638bf23d5b431
2019-11-13 23:24:06 +01:00
David Lynch 46e7b3ba19 Config value for X-Parsoid-Variant
Bug: T229074
Change-Id: Ib1403638b12ec5808f6b81bd114949043aa9ac2e
2019-11-05 10:56:10 -06:00
Ed Sanders 76d0f02116 Use MobileFrontend check for loading DesktopArticleTarget.init
Bug: T236944
Change-Id: I3fd41d0fbb3087d4052db1cb1537e289defa737e
2019-11-01 22:05:59 +00:00
Ed Sanders 1bb72f0bb5 Replace deprecated easy-deflate.deflate with mediawiki.deflate
Change-Id: I5c77d4818074fd3dc937d7688d449952b92ee358
2019-10-30 19:13:47 +00:00
James D. Forrester 2479f5c7f8 Drop use of wgParser, replaced in 1.32 and to be removed in 1.35
Bug: T160811
Change-Id: Id7332a19d64d83bcbccfd3ac89464dfea593cdc2
2019-10-28 20:10:14 +00:00
Bartosz Dziewoński f31bcc219f ApiVisualEditor: Fix preload handling further
Follow-up to 57ad605dc4.

Pass parameters like when switching from wikitext editor:
* bodyOnly=false
* stash=true

Bug: T233320
Change-Id: Ied2d9a48e884e033ef9d41b2da9cfa3599784ae0
2019-10-28 13:42:00 +01:00
Bartosz Dziewoński 57ad605dc4 ApiVisualEditor: Return 'etag' with 'content' for preloaded content
Previously we were not returning it, so when saving the edit, wikitext
syntax would not be preserved. This was probably not a big problem,
but I noticed it coming up in the logs for T233320.

Now making an edit starting with preloaded content behaves like
switching from wikitext to visual mode, rather than like starting the
edit in visual mode.

Similar to 679e777cfa.

Bug: T233320
Change-Id: Id1ee6877b103fa4274deec11b1b3cacbdcdae606
2019-10-23 22:24:52 +02:00
Bartosz Dziewoński cbd500a9ee Don't log missing ETags when creating a new page, that's normal
Same idea as f3dfd98e55. Oops.

Bug: T233320
Change-Id: Id31bd4806da5489a4438d385553a22d33676fc3a
2019-10-23 22:15:03 +02:00
Bartosz Dziewoński f7ee7dc807 Try using structured logging again
The configuration of Wikimedia wikis should be fixed.

This reverts commit 04407e9eb1
and also makes similar changes to new logging code added in
5d1a67757a.

Bug: T234564
Change-Id: Ic999b050e68b71f5a1737366e16f133e5a557307
2019-10-21 17:04:23 +02:00
Daimona Eaytoy dd1d022c9d build: Bump mediawiki-phan-config to 0.8.0
Change-Id: Iafcf36672189c7729e9936634d95e585ed2247be
2019-10-20 12:27:16 +00:00
Bartosz Dziewoński 5d1a67757a Detect mangled etags from RESTBase and retry via MediaWiki API
Something is causing the 'ETag' headers produced by the "public"
RESTBase (queried directly from the client) to be mangled or lost.
My theory is that some proxy or browser extension is doing that.

When we detect a bad etag when fetching the page contents, discard
the result and try querying the "private" RESTBase via the MediaWiki
API (similar to what we do on private wikis, except there we talk
directly to Parsoid instead of RESTBase). After I463a84de63, that
returns the etag as part of the payload rather than HTTP headers,
and should pass unharmed through whatever is mangling the data.

Also compare and log the two etags.

Bug: T233320
Change-Id: I2ef0ca872597566f74b650aea71bf3f15747a6d7
2019-10-16 19:53:43 +02:00
Bartosz Dziewoński 679e777cfa ApiVisualEditor: Always return 'etag' with 'content'
For consistency, I guess. Also I need this in I2ef0ca8725.

Previously, when querying the HTML content of an existing page, we did
not return the 'etag', on the assumption that anyone who needs it will
instead query RESTBase directly.

Bug: T233320
Change-Id: I463a84de631598243893946ad1d060a9aa0b180e
2019-10-15 18:31:56 +00:00
James D. Forrester dec54cf56e build: Upgrade mediawiki-codesniffer to v28.0.0
Change-Id: I23702d16eee09292b63051f94103a3bca3b1dd13
2019-10-11 12:42:23 -07:00
Bartosz Dziewoński 04407e9eb1 Don't try to use structured data in structured logging, it doesn't work
Our log messages were being silently dropped. Experimentation revealed
that our structured logging system doesn't actually like it when we
try to log structured data.

See: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/540464/3/includes/ApiVisualEditorEdit.php

Put it all in the message strings, whatever.

Change-Id: Iae778f95774df2e24b30387221e39e097e25a4cf
2019-10-02 23:13:40 +02:00
Bartosz Dziewoński df0c8ad02d ApiVisualEditorEdit: Add logging for funny etags
Bug: T233320
Change-Id: I0f321df057068e1dd396a04a9e194853c2b0e9e4
2019-10-02 03:23:29 +02:00
Bartosz Dziewoński 9ce8ae05c7 ApiVisualEditor: Add logging for RESTBase HTTP errors
Bug: T233127
Change-Id: Ide5138d8f8f462b9c3d7da10f26ff57c9d17f1c9
2019-10-02 01:00:32 +02:00
Bartosz Dziewoński ca3c887e36 Fix loading icons for historical diff mode switcher
The 'eye' icon is in the 'accessibility' pack, not 'alerts'.
Compare to the dependencies of 'ext.visualEditor.diffPage.init'.

Change-Id: Ie14ab6be756fd9e0bef59475466674a41273046f
2019-10-01 03:31:27 +02:00
Bartosz Dziewoński 7c2e61d502 ApiVisualEditorEdit: Remove special handling for SpamBlacklist
No longer needed after Id36aa6bdb8f873fe7deb8123a7fc774103721c01,
which teaches SpamBlacklist to return its own error messages.

Depends-On: Id36aa6bdb8f873fe7deb8123a7fc774103721c01
Bug: T211443
Change-Id: I462c2002f9b596cbdfd7ce3673d4e362e5bd1aaf
2019-09-11 21:55:25 +00:00
Bartosz Dziewoński c0eb57ed3b Remove Phan suppression for a fixed false positive
Unnecessary suppression causes build failures. Probably fixed by the
EditPage.php changes in e2e543f7c2a98f40c9b43ba3989d0f6689f4cb67.

Change-Id: I2ac7e95886ce6bef2ba08e1614728caae7d26442
2019-09-02 21:50:16 +02:00
Ed Sanders e5f5a49344 Support for defined template context items
Context items can be created for specific template titles. Titles
are mapped to context items using an on-wiki message.

Bug: T211243
Change-Id: Icfc39e350452da238d0e0c17cb2305c60d9ca16a
2019-08-30 13:02:47 +01:00
Petr Pchelko c0d2d52e95 Remove usages of deprecated MWNamespace.
Bug: T11977
Change-Id: I6da497464a77286d5fd2d30a85e70de85fe1c868
2019-08-26 17:49:52 -07:00
DannyS712 00a98dd8f2 Fix 'paramter' typo in code and add to typos list, now covering PHP
Bug: T201491
Change-Id: I28d3b3871a2de54e575163bec7c364b68da8d5a6
2019-08-20 12:10:04 +01:00
Ed Sanders 393de5985f Update VE core submodule to abf2bfa85e64e67cdf963601fe1da2a11fd9e89a
New changes:
1a7460058 Remove ve.newMobileContext feature flag

Local changes:
* Remove ve.newMobileContext feature flag

Change-Id: Ia8def997b7cba4623866080752b06068d2118cc3
2019-07-23 22:12:48 +00:00
daniel b898c417b4 Removes forward-compat code needed for method rename in core.
Depends-On: If47a93878f87d69800e5f305404c22528dac5e94
Change-Id: I2181f1a39b47078a32a8de68ac63d3144fc5b807
2019-07-23 21:38:52 +02:00
Ed Sanders df8feb6faf Move mobile context to bottom of page
Hidden behind ve.newMobileContext feature flag.

Bug: T204733
Depends-On: Id276686a0e82c12c457c81eaec9939722c65c7ec
Depends-On: Id5f7ead769dc30c0fbd2a8b8f6f6c4d68dcfabac
Change-Id: Ibd4b699dfe4bb9bcaec6898b6b82357eb287d128
2019-06-14 20:57:22 +00:00
Umherirrender e1442aa343 Add phan
Change-Id: I7352036536c1c8415b681f48f3ee0dcec315c035
2019-05-31 14:48:22 +00:00
Thalia cdb3b880af Use MediaWiki\Block\DatabaseBlock instead of Block
This follows the rename of the Block class in I6d96b63ca0.

Change-Id: Ib652feb34b7f10726ec775ff2929ca12ed66a8e1
2019-05-31 15:34:00 +01:00
Bartosz Dziewoński 8ae4925676 Allow switching from WTE to VE with changes in non-RESTBase mode
* Change the query in ve.init.mw.ArticleTargetLoader#requestParsoidData
  so that in non-RESTBase mode with wikitext it still returns the
  metadata required to initialize the editor, using the backend API
  code added in I1b35b28e428a1f86d2e34d90ddbe73361ce14818. This fixes
  the exception from T222312.

* Introduce new configuration option $wgVisualEditorAllowLossySwitching
  to control this feature. It is enabled by default, fixing T214542.
  We allow it to be disabled because switching in non-RESTBase mode may
  cause "dirty diffs" (non-semantic changes to the wikitext), which are
  undesirable on wikis where users carefully review all changes.

Bug: T214542
Bug: T222312
Change-Id: I58879cba5612002c70c24731306214d2577c2c52
2019-05-30 20:18:53 +02:00
Umherirrender c9c4b68d25 Remove class_exists by ExtensionRegistry check for ConfirmEdit extension
Change-Id: I6ffb1842600316f2a6309a0028e96e75fe75f0c8
2019-05-29 12:10:02 -07:00
Ed Sanders 4a692e762d Special-case redlink URLs to load preferred editor
In general action=edit could be bound to a wikitext-specific
edit link, but in the case of redlinks we can use the
preferred editor instead.

Bug: T223793
Change-Id: Ib0851e9e2ce441ae93311153801e2c3de0a2063d
2019-05-26 17:55:38 +01:00
jenkins-bot e6d885789e Merge "Check if page is really editable and call #setReadOnly accordingly" 2019-05-18 18:10:59 +00:00
Bartosz Dziewoński 222ada6a8e VisualEditorHooks: Mark the 'preview' parameter as unsupported
We don't currently support it in NWE. It has a very different design
for previews that wouldn't really do what users expect. Let the old
editor handle this.

Bug: T195914
Change-Id: If0c0312347c212447bd8da7336c80bd4a1cb246a
2019-05-18 19:08:31 +02:00
Bartosz Dziewoński b9835f75d3 Check if page is really editable and call #setReadOnly accordingly
There are various circumstances where the wgIsProbablyEditable check
gives incorrect results (hence the 'probably'):

* User is blocked (T111217)
* Page is protected from creation (T173763)
* Page is transcluded on a cascade-protected page (T217217)

Bug: T111217
Bug: T173763
Bug: T217217
Change-Id: I7df8909c31f29d2e7521bef8612c27cb61146a4d
2019-05-18 17:23:31 +02:00
Ed Sanders 3285b7dbe5 Initialize $restbaseHeaders to null
Bug: T223281
Change-Id: I8bead40c35323cd4082f55ac529f900403f76f37
2019-05-14 16:07:22 +01:00