Commit graph

219 commits

Author SHA1 Message Date
David Lynch 0a972795e9 API/getLangLinks: Use isset when looking up $langnames
This should just result in an empty `td` for the language name, rather than
any more-severe breakage.

Bug: T154962
Change-Id: I59d429777ab790e922f08e01a1c262fa2b082292
2017-01-10 14:27:25 -08:00
Alex Monk 8fe5bbe39b More error handling fixes
See T154565

Change-Id: I073aae149497342157503ad3f465b7d57aaad4fa
2017-01-05 15:13:02 +00:00
Ed Sanders 808de2acea Add "templates used" page to meta dialog
Bug: T149009
Depends-On: Id617f9afbddf094140133f9659efc4b4e746148c
Change-Id: I63e663d05aefb47274f1f28bdcafc5317c2fc4f6
2017-01-04 18:30:11 +01:00
jenkins-bot 2b913fb10c Merge "Add editintro to notices" 2017-01-03 20:19:06 +00:00
jenkins-bot 8723481005 Merge "Don't allow $section to be unset" 2017-01-03 18:57:46 +00:00
James D. Forrester 122f49b2dd build: Bump file copyright notices for 2017
Change-Id: I3c20809e71cc0da58123e1b5f29c4f3aac945496
2017-01-03 08:58:33 -08:00
Ed Sanders 58071f59f1 Add editintro to notices
Bug: T56029
Bug: T51622
Change-Id: Ib43cc66b817ff394b4f1c82fcba4503df825819c
2016-12-31 23:23:17 +00:00
jo12bar 0533c329fb
Replace all usages of Linker::link() with LinkRenderer
Linker::link was deprected in 1.28. This replaces all usages of
Linker::link with an instance of LinkRenderer in ApiVisualEditor.php, as
this seems to be the only file generating links with Linker::link.

Bug: T149346
Change-Id: Ib395f137787e7dd7c5cfe91905f5feb88ce9f604
2016-12-30 21:27:17 -08:00
Ed Sanders ab78f52fa9 Don't allow $section to be unset
Change-Id: I46a36a08fc2e98aeb35774af8b26ebee313965f3
2016-12-18 11:30:18 +00:00
Alex Monk 5d5645565f Fix I0e802a47: Don't try to send dieWithError error codes as integers
Bug: T152429
Change-Id: If882b14adc945ca49e51a912a676aee0be9c9fec
2016-12-16 11:10:31 +00:00
jenkins-bot 8861ec2d35 Merge "Get content format from EditPage, instead of guessing 'text/x-wiki'" 2016-12-14 01:14:04 +00:00
jenkins-bot b857300853 Merge "getlanglinks: Get rid of backwards-compat stuff" 2016-12-13 19:29:52 +00:00
Ed Sanders 5a8106773c Support section=new in NWE
Bug: T150709
Change-Id: I1002b97060d642df0988da15860a36c13712bade
2016-12-13 12:20:55 +00:00
Ed Sanders ec56a700f1 Get content format from EditPage, instead of guessing 'text/x-wiki'
Change-Id: I45918fab0f3bbac07d86d79f9539c3041b6f119e
2016-12-10 20:03:07 +00:00
jenkins-bot a04cef294e Merge "Update for API error i18n" 2016-12-06 20:04:24 +00:00
Alex Monk b51720e165 Respect oldid parameter in NWE
Change-Id: I5a6388f50cc432421343974eb9f721f5e5a94d93
2016-11-23 00:47:42 +00:00
Brad Jorsch 26e24c2d09 Update for API error i18n
See Iae0e2ce3. Since VisualEditor master requires core master, this just
depends on the master patch instead of trying to maintain BC.

Depends-On: Iae0e2ce3bd42dd4776a9779664086119ac188412
Change-Id: I0e802a47302725f062334a437bff84e3b2b8b9a6
2016-11-14 12:47:01 -05:00
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 995ea38466 getlanglinks: Get rid of backwards-compat stuff
We can handle the new structure etc.

Change-Id: If8613f66b00f4fffe3936baec7d13214b9a676d0
2016-10-08 20:44:59 +00: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