Commit graph

201 commits

Author SHA1 Message Date
jenkins-bot eabd56618b Merge "Set Api-User-Agent in requests to RESTBase/Parsoid" 2016-10-27 23:24:09 +00:00
Kunal Mehta b393ff7e83 API: Use ::class PHP feature
Change-Id: Ic57cde6098b2a04e76186c75d621ade75de04180
2016-10-27 12:33:17 -07:00
James D. Forrester 7eeb66f63e Set Api-User-Agent in requests to RESTBase/Parsoid
Bug: T149050
Change-Id: I7670450724f18865a7d9c7c7eb182449964f32b0
2016-10-27 08:56:19 -07:00
Roan Kattouw 13801bb6d3 ApiVisualEditor: Move diffing and serializing to ApiVisualEditorEdit
These require POST, especially paction=serializeforcachekey because
it calls ApiStashEdit::parseAndStash() which needs a master DB connection.
Move them to the edit module so we can require POST for that one and keep
allowing GET for the main module. This fixes the warnings we currently get
for using parseAndStash() in a module that does not require POST.

Change-Id: I64a8ed7305105fa4c46902b99984306a7ff468cc
2016-10-21 15:24:13 -07:00
Ed Sanders 4040442ad8 Section editing in NWE
Bug: T144654
Change-Id: Ida6e721e0d980b47e3fda6a1f0744cbce1b2235a
2016-10-12 12:55:11 -07:00
Alex Monk 5e25cda633 Fix getlanglinks response to deal with no links
When no langlinks are returned by the API, it just doesn't set the langlinks
property.

Also, get rid of indexpageids while we're here.

Change-Id: Icfb8c0abb02aeb3e9cdbefe0df7bb6b5476b78a4
2016-10-08 19:06:19 +00:00
Alex Monk fba850f6e8 Don't call ApiBase::getResultData anymore, it's broken on core master and is deprecated anyway
Change-Id: I64066a77611a51bae777588820608cc9fa63b02e
2016-09-29 23:36:00 +01:00
Alex Monk 8a80b5bbc3 Split isAvailable from visual-specific checks
Not fully tested

Bug: T146182
Change-Id: I5d7ae6e49991660ecdc2daf46b319947f83a1018
2016-09-20 23:53:53 +01:00
Brad Jorsch d7247efc90 Remove pre-1.25 API compatibility code
Since this extension uses extension.json, it already requires 1.25+ so
no need to keep the old code around.

Change-Id: Iff2eeb2bbfba15c84a4fcec85b6647c28886e9aa
2016-09-20 15:32:23 -04:00
James D. Forrester 36d13a845d Follow-up bfc3ac69: Align with coding conventions
Change-Id: I059cbd5ff3d693230567bb9267b01df491b3e2f8
2016-09-13 08:15:09 -07:00
Aaron Schulz bfc3ac69ec Avoid DBPerformance log warnings due to isBlockedFrom()
Change-Id: I276656ab854d2566b81774360d2bf155fa609ae8
2016-09-12 10:22:09 +00:00
jenkins-bot 69b7a262ec Merge "Follow-up 51dd790 & c40070b: Drop T135171 debug tracking" 2016-09-01 19:26:14 +00:00
Aaron Schulz 3718757f59 Avoid master queries from getUserPermissionsErrors()
Change-Id: I4f5bcd7e89a78f8b52bce445a83deb1581ec1641
2016-08-28 10:16:08 -07:00
James D. Forrester 1993c51a49 Follow-up 51dd790 & c40070b: Drop T135171 debug tracking
Apparently this is now fixed, so no need to keep this.

Bug: T135171
Change-Id: Ie5c0f9140c6de4bb73770276011adce23fa69f9e
2016-08-22 11:28:22 -07:00
jenkins-bot 9f7016871f Merge "Always forward cookies when $wgVisualEditorParsoidForwardCookies is set" 2016-08-15 23:21:02 +00:00
Ed Sanders c452e134cc Wikitext surface alpha feature
Edit wikitext with the VE interace.

Bug: T104479
Bug: T142138
Change-Id: Ic95b47e0dd378578555c4a2342ca9c87064ed1d5
2016-08-12 18:37:29 +00:00
Ed Sanders f1482627fa Factor out API deflation and change storeInSerializationCache API
Change-Id: I7e2e15a8ba5088e6c370cb035c71f7af18c13b61
2016-08-09 20:08:34 -07:00
Mark A. Hershberger 4c275a5467 Always forward cookies when $wgVisualEditorParsoidForwardCookies is set
Assume the person setting up the wiki knows what they're doing since
we've warned them quite a bit already in the on-wiki documentation.

Bug: T140129
Change-Id: I1c7ffb22eba5ab5b5e7f92ae23da8fe9edf2606d
2016-07-12 13:01:24 -04:00
Aaron Schulz e2d7eea8a7 Use debug() for spammy edit stash log messages
Change-Id: I154d6ff867f8b85b91a83f7351dd1f455d308690
2016-07-07 17:00:59 -07:00
jenkins-bot 6f05edcd72 Merge "Revert "Use debug() for stash messages to match core"" 2016-07-07 22:09:23 +00:00
Jforrester 660cae8514 Revert "Use debug() for stash messages to match core"
This reverts commit 693b28a4bb.

Bug: T139469
Change-Id: I54ae58a113977ffa31f0a82b2ca93938b35e842b
2016-07-07 21:59:02 +00:00
Alex Monk e639525a9c Follow-up I9202066d: array_unique leaves gaps in keys, we need to run array_values on it afterwards
While that commit fixed the issue it was intended to address, it also
completely broke VE everywhere else. Basically you'd end up with a result
like this:

array(5) {
  [0]=>
  int(14)
  [1]=>
  int(6)
  [2]=>
  int(2)
  [5]=>
  int(0)
  [6]=>
  int(250)
}

With the lack of 3 and 4 keys making the JSON formatter think we've got an
object.

Bug: T139094
Change-Id: Ia21fd4bd352afc9170357576a3e0eb17b4528326
2016-06-30 20:35:45 +01:00
Alex Monk ea1a621c47 Fix preference namespace list to handle duplicates
Change-Id: I9202066d23eca527571ac817cf3ae64bc2d57bea
2016-06-29 23:24:34 +01:00
David Lynch 3c5695e87d Don't use array_merge for namespace configs
array_merge renumbers numeric keys. The namespace configs can be either
numeric or names. If they're numeric, they shouldn't be renumbered. So just
add them.

Bug: T138980
Change-Id: I3e3ecb3e9e65443ba0d44f8eeb67d6b390eca0bd
2016-06-29 16:13:21 -05:00
Alex Monk bf0953b07b Remove consideration of extension registry configured namespaces until we can find the correct way to merge them
This will disable ProofreadPage's addition of the Page namespaces (e.g. on
wikisources), but this is more important right now.

Bug: T138980
Change-Id: I23ee26fa95a01b3e0881a4ca16e70247839d9cd9
2016-06-29 21:48:33 +01:00
Tpt 9efd96cced Execute the EditFormPreloadText hook on load for non-existent pages
Note that this does not add support of the preload GET parameter,
which is in T51622.

Bug: T138588
Change-Id: I46ade4de02f15444c1ca5731a475ed89b31960d9
2016-06-25 08:50:22 +00:00
jenkins-bot 63f15d310f Merge "Use debug() for stash messages to match core" 2016-06-22 08:04:03 +00:00
jenkins-bot c2281a2a8c Merge "Make namespace and content model lists extensible" 2016-06-21 15:20:30 +00:00
Aaron Schulz 693b28a4bb Use debug() for stash messages to match core
Change-Id: I366d14d41143d55740e178a16b0af84c5a8ea272
2016-06-20 14:50:26 -07:00
Aaron Schulz eee86a9873 Pass empty summary to parseAndStash() to avoid warnings
Since the summary is not known yet, using "" is fine.

Bug: T137995
Change-Id: I0ef2a6cbe3ffc9be249bfea5e4172159c57698a2
2016-06-16 13:24:11 -07:00
Ed Sanders 6ee6ac7bdf Make namespace and content model lists extensible
This should really be done automatically by resource loader,
but merging only works on globals. We use this same hack
for plugin modules.

Change-Id: I5f729ddb6146565dc839f60353ac8fa5b2a29ca8
2016-06-01 09:29:34 -07:00
Ed Sanders 796da84576 Allow extensions to support extra namespaces and content models
Change-Id: If67bab93da355da609b6df274514b5c72a6ed91a
2016-06-01 01:55:03 +01:00
Aaron Schulz 838d5bc7e4 Send edit stash metrics for cache attempts
Change-Id: Ic5ffcb20ca9062748c2cde232d6aa4ee1522aa55
2016-05-26 21:27:33 +00:00
Alex Monk c40070b5cf Debug log strange-looking ETags being sent to RB
Bug: T135171
Change-Id: Ie127cfbd515cd217abd272cb7a81566b91e13f4d
2016-05-19 03:33:40 +01:00
Ed Sanders 216ef78cb0 [DEPRECATING CHANGE] Use canonical namespace names for enabling VE
These are more meaningful and the actual namespace IDs used can
vary, especially for extensions.

Change-Id: I781d484d7525ff09b5d348e79b63b161a7a26997
2016-05-04 18:56:00 +01:00
Bartosz Dziewoński 2ff4195772 Simplify GlobalBlocking code
Depends-On: I2893b9e24173d21fe518c360f6c6add363cc7b23
Change-Id: I242e5daaeda4e981099228ffa860b274a9794127
2016-04-25 23:55:22 +02:00
jenkins-bot 5dc1257507 Merge "More minor/watch checkbox state computation server-side" 2016-04-11 14:18:56 +00:00
Alex Monk 149dab8fc5 Add ?redirect=false to VE's RB /page/html/ requests
Untested.

Bug: T130757
Change-Id: I27570d3212bd41bf7da93608302dae04c364783f
2016-04-09 03:34:34 +01:00
Roan Kattouw 12eb41acff More minor/watch checkbox state computation server-side
Following through on my threat from 72b0d2a19c (November 2013).

Change-Id: I0daeef2a0373bbdb06627053e9d726d6fc20a3f6
2016-04-08 18:02:01 -07:00
Alex Monk 1c455a5fb8 Set User-Agent in server-side VRS requests to RESTBase/Parsoid
Bug: T131171
Change-Id: I385ef1f3efb674c4ad3ffb334c0ff5b830f89a37
2016-03-30 01:05:50 +01:00
Alex Monk d2a9aefba7 Better handling of read-only mode
* Don't just fail to load, action=visualeditor itself should not write to the DB
  (we have action=visualeditoredit for that)
* Send notice to the client in the usual way
* Handle read only errors on save, log as unknown

This won't let you review changes because that uses visualeditoredit

Bug: T129501
Change-Id: Id78c06b031423e47a7ddf94ec615b6d6975309d3
2016-03-10 21:02:52 +00:00
Alex Monk 4ed6fd4010 Change Accept header a bit
Per post-merge commit on I77af4b58 by Subbu

Bug: T128233
Change-Id: I30c4c1ad5b68e5b8a006d7a6c7bcbaac7e2eb164
2016-03-02 15:37:37 +00:00
Alex Monk 2f135e9590 API: Send Accept: header to RESTbase
Bug: T128233
Change-Id: I77af4b58e5469a898063a3f838802e4f5769514b
2016-03-01 01:14:02 +00:00
James D. Forrester e7a3ec43bf build: Update mediawiki-codesniffer to 0.6.0, add "composer fix"
Change-Id: Ic96081539c2ae98b5b239b59ca9b0362b337e522
2016-02-17 08:18:02 -08:00
James D. Forrester 8063603ca5 [BREAKING CHANGE] Drop MW pre-1.25 PHP API documentation compatibility
getDescription() and getParamDescription() have been replaced by a proper i18n-based
API documentation system since MediaWiki 1.25. Retaining these does not help us with
backwards-compatibility given that the repo already requires MediaWiki 1.27.0-alpha,
so just drop them before they become out of date.

Change-Id: Ic8b87235aeb7e1bcd7b24d5609c7d002658a66ba
2016-02-06 17:43:37 -08:00
James D. Forrester ada58df361 build: Bump file copyright notices for 2016
Change-Id: I3c618c196e504a80ca297a4132a17f1977a24fb7
2016-01-03 14:57:25 -08:00
Bartosz Dziewoński 8afae11a1c ApiVisualEditor: Return the correct notice when user is not allowed to create page
'nocreatetext' is only the right error message when anonymous users
are generally not allowed to create pages on the wiki. But there are
other situations, for example a title might be blacklisted.

Change-Id: I7b8e83fa0bf98449e63e67705b709d227d9a379f
2015-11-05 04:02:42 +01:00
Alex Monk 85b745666f Allow switching from wikitext to VE
Just by pressing the VE tab for now

Requires a relatively new version of restbase

Bug: T49779
Change-Id: I2a5294345f5e0f469c1dd1bdd29dbce211571a4e
2015-11-02 20:55:19 +00:00
James D. Forrester 5732bd26fb ApiVisualEditor: Switch RESTbase config from 'scrubWikitext' to 'scrub_wikitext'
Change-Id: I08ca5eab1423232b96faf39f12b25b679a0d77bd
2015-10-17 00:07:34 +00:00
jenkins-bot e14c8e11cf Merge "Change a bunch of parsoid references to acknowledge that RESTBase is sometimes in the middle" 2015-10-01 16:14:29 +00:00