lhc/web/wiklou.git
8 years agoRevert throwing exceptions on preg_* failures
Gergő Tisza [Thu, 29 Oct 2015 21:52:44 +0000 (14:52 -0700)]
Revert throwing exceptions on preg_* failures

This reverts I3840a56adc0a6e50963b930051892491f8e90245 which
threw exceptions on broken UTF-8 in $text.

Bug: T115514
Bug: T117066
Change-Id: Ie665056a13f9e3678a49790d787b0a41dbba6362

8 years agoFix "Notice: Undefined property: Category::$mId" errors
Aaron Schulz [Thu, 29 Oct 2015 21:36:29 +0000 (14:36 -0700)]
Fix "Notice: Undefined property: Category::$mId" errors

This should also improve performance while at it.

Change-Id: Ib62ce801f597c653d0a8d5fc19b81c1ce8e0f5f2

8 years agoMerge "Include preg_last_error() in error message when preg_* fails"
jenkins-bot [Thu, 29 Oct 2015 21:19:32 +0000 (21:19 +0000)]
Merge "Include preg_last_error() in error message when preg_* fails"

8 years agoInclude preg_last_error() in error message when preg_* fails
Gergő Tisza [Thu, 29 Oct 2015 20:49:11 +0000 (13:49 -0700)]
Include preg_last_error() in error message when preg_* fails

Bug: T115514
Bug: T117066
Change-Id: I1d13f8542a4cf11c8e87cd4f6a983fa852dfdf1e

8 years agoMerge "Styling tweaks for inline interwiki search"
jenkins-bot [Thu, 29 Oct 2015 20:44:18 +0000 (20:44 +0000)]
Merge "Styling tweaks for inline interwiki search"

8 years agoMerge "[search] Fix method call on null value"
jenkins-bot [Thu, 29 Oct 2015 20:41:00 +0000 (20:41 +0000)]
Merge "[search] Fix method call on null value"

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 29 Oct 2015 20:06:27 +0000 (21:06 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: Ia42d861907521a354efd99d97703c09035927fd2

8 years agoAPI: Be consistent in siteinfo showhooks output
Brad Jorsch [Thu, 29 Oct 2015 17:40:52 +0000 (13:40 -0400)]
API: Be consistent in siteinfo showhooks output

This was originally made 'BCarray' to avoid breaking BC, but in this
case the nonstandard output is so rare it's probably best to just be
internally consistent.

Bug: T117022
Change-Id: I501c415f6170383c163110b00e54ac88c3dfec89

8 years agoMerge "mediawiki.Upload.BookletLayout: Allow for asynchronous initialization"
jenkins-bot [Thu, 29 Oct 2015 15:59:59 +0000 (15:59 +0000)]
Merge "mediawiki.Upload.BookletLayout: Allow for asynchronous initialization"

8 years agoMerge "TitleWidget: Sort results correctly"
jenkins-bot [Thu, 29 Oct 2015 15:15:46 +0000 (15:15 +0000)]
Merge "TitleWidget: Sort results correctly"

8 years agoTitleWidget: Sort results correctly
Ed Sanders [Thu, 29 Oct 2015 13:18:42 +0000 (13:18 +0000)]
TitleWidget: Sort results correctly

Bug: T117039
Change-Id: Ie86c1751dacb5c32afe708b354809b914a54ea51

8 years agoRemove ORM code from core
Reedy [Tue, 6 Oct 2015 15:58:18 +0000 (16:58 +0100)]
Remove ORM code from core

Bug: T114538
Change-Id: Ic4196ca9da927fc5c85b01cfff65f0636e3202ae

8 years agoMerge "Add tests for MemcachedBagOStuff::validateKeyEncoding"
jenkins-bot [Thu, 29 Oct 2015 11:56:17 +0000 (11:56 +0000)]
Merge "Add tests for MemcachedBagOStuff::validateKeyEncoding"

8 years agoMerge "Convert buildSidebar() to using getWithSetCallback()"
jenkins-bot [Thu, 29 Oct 2015 08:04:32 +0000 (08:04 +0000)]
Merge "Convert buildSidebar() to using getWithSetCallback()"

8 years ago[search] Fix method call on null value
Erik Bernhardson [Thu, 29 Oct 2015 01:37:22 +0000 (18:37 -0700)]
[search] Fix method call on null value

Seeing these pop up in the production logs. This can be null under
certain circumstances, so expect and handle it.

Change-Id: I25a355174e0ad93280eccffd4ec711a641d14bf3

8 years agoLanguage: Remove logic for class file inclusion
Timo Tijhof [Thu, 29 Oct 2015 01:02:58 +0000 (01:02 +0000)]
Language: Remove logic for class file inclusion

* Remove strcspn() check in newFromCode already in isValidCode().
* Leverage the autoloader instead via class_exists instead of
  including files based on user input.
* Create fallback instance directly instead of recursing back
  into newFromCode().

* Remove method preloadLanguageClass (unused).
* Remove method getClassFileName (unused)

Change-Id: I90035ca4b07facae051b1a584e92df72b42c4a49

8 years agoConvert buildSidebar() to using getWithSetCallback()
Aaron Schulz [Wed, 28 Oct 2015 05:25:36 +0000 (22:25 -0700)]
Convert buildSidebar() to using getWithSetCallback()

Change-Id: Id9a27ba2bbd3aceee26bf35844d1c970dbb32d47

8 years agoMerge "Fix slow callbacks in getWithSetCallback() using lockTSE"
jenkins-bot [Wed, 28 Oct 2015 23:51:37 +0000 (23:51 +0000)]
Merge "Fix slow callbacks in getWithSetCallback() using lockTSE"

8 years agoClient-side migration for empty li preservation
Tim Starling [Wed, 14 Oct 2015 03:16:44 +0000 (23:16 -0400)]
Client-side migration for empty li preservation

It is desirable in terms of user-friendly syntax to display an empty
list item if the user adds one to the source. However, we suspect that
this change will break the rendering of existing templates. So, preserve
the empty <li> element, but style it with display:none so that there is
no user-visible change. Changes can then be observed with a user script,
then eventually the CSS can be removed so that the desired behaviour will
be user visible.

This is imagined as a staged deployment of T89331, i.e. it is better to
resolve differences with Html5Depurate one at a time instead of
deploying it all at once.

The CSS module is specified in parser/MWTidy.php since the tidy driver
hierarchy is not meant to be so closely tied to the MW environment.

Bug: T49673
Change-Id: Ifb44b782c617240e3de73dcdf76c8737c7307d94

8 years agoFix slow callbacks in getWithSetCallback() using lockTSE
Aaron Schulz [Fri, 23 Oct 2015 02:36:59 +0000 (19:36 -0700)]
Fix slow callbacks in getWithSetCallback() using lockTSE

* Keys that take a long time to generate would run into
  the MAX_SNAPSHOT_LAG check and have set() no-op. This
  would be fine except that leaves no key there to figure
  out the time since expiry and therefore whether to use
  the mutex, so it didn't. This now saves the keys but with
  a FLG_STALE bit set, making the next caller that sees it
  perform a regeneration (unless it can't get the mutex).
* Bumped LOCK_TTL so that keys can stay locked much longer.
* This is easy to test via sleep(5) in tagUsageStatistics()
  and two Special:Tags browser tabs.

Bug: T91535
Change-Id: I549e70ace3d2e7da40d3c4346ebacc36024cd522

8 years agowikimedia/running-stat 1.0.0 → 1.1.0
Ori Livneh [Wed, 28 Oct 2015 22:31:47 +0000 (15:31 -0700)]
wikimedia/running-stat 1.0.0 → 1.1.0

9d7170d3ee: Rename RunningStat::push() to RunningStat::addObservation()
09b6e53be9: Add PSquare class for online percentile estimation

mediawiki/vendor change: I48dd51c9068

Change-Id: Ie6b19833c282e0f493c4d306807366a6671455a8

8 years agomediawiki.Upload.BookletLayout: Allow for asynchronous initialization
Bartosz Dziewoński [Wed, 28 Oct 2015 21:28:51 +0000 (22:28 +0100)]
mediawiki.Upload.BookletLayout: Allow for asynchronous initialization

It happens to be convenient, since it turned out that we need to fire
a few API requests to correctly render some bits of the UI.

Follow-up to 86dedeea7f7cae5452acf5162672f34c32b593fd. This makes the
code less hacky and more reliable.

Change-Id: I65a92e3915a6844056fb7b3a2758a168eb12e6b8

8 years agoFix diff/history links not showing up for ungrouped enhanced RC
Kunal Mehta [Wed, 28 Oct 2015 20:48:46 +0000 (13:48 -0700)]
Fix diff/history links not showing up for ungrouped enhanced RC

Looks like a typo or accident from d40cd42b9f960c.

Bug: T116899
Change-Id: I33b65afa78480612b9312282922686a64346fef2

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 28 Oct 2015 20:31:22 +0000 (21:31 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I29f42fc05b323dacc3dd33ebbd26bf4e50c25bfa

8 years agoHTMLRadioField: Use another variable for the radio value to avoid conflicts
Florianschmidtwelzow [Wed, 28 Oct 2015 14:39:39 +0000 (15:39 +0100)]
HTMLRadioField: Use another variable for the radio value to avoid conflicts

$value is used in a foreach loop to build the radioselect fields array for OOUI,
but $value is also the variable, which holds the default value for the element
(or a value, which ws submitted by the user), to pre-select the correct radio input
field. That results in the problem, that $value will always contain the last data,
which passed the foreach loop, and always the last radio input field will be pre-
selected, no matter, what the developer defined as the default or what the user
submitted in a prior form instance.

Change the variable used in the foreach loop to avoid this conflict.

Change-Id: I36c760be8ccd86e75249c966f697b499576c83d4

8 years agoAdd tests for MemcachedBagOStuff::validateKeyEncoding
Thiemo Mättig [Wed, 28 Oct 2015 15:26:37 +0000 (16:26 +0100)]
Add tests for MemcachedBagOStuff::validateKeyEncoding

If3e20c6 and the following patches introduced a breaking change and
cause a regression in Wikibase because we are using the version number
constant as part of a cache key prefix. Currently the Wikibase version
is set to "0.5 alpha".

Space characters were allowed before and encoded as "%20". This does
not happen any more.

Change-Id: Ia2fd4ed6738a10e02050bced947ef5d4e8b98980

8 years agoMerge "Make WAN cache HOLDOFF_TTL smaller by combining db/snapshot lag"
jenkins-bot [Wed, 28 Oct 2015 15:10:40 +0000 (15:10 +0000)]
Merge "Make WAN cache HOLDOFF_TTL smaller by combining db/snapshot lag"

8 years agoMerge "resourceloader: Consistently refer to the framework as ResourceLoader"
jenkins-bot [Wed, 28 Oct 2015 14:53:58 +0000 (14:53 +0000)]
Merge "resourceloader: Consistently refer to the framework as ResourceLoader"

8 years agoMerge "resourceloader: Remove 'loaderScripts' option from FileModule"
jenkins-bot [Wed, 28 Oct 2015 14:53:37 +0000 (14:53 +0000)]
Merge "resourceloader: Remove 'loaderScripts' option from FileModule"

8 years agoMerge "Add help link to Special:Search"
jenkins-bot [Wed, 28 Oct 2015 11:58:26 +0000 (11:58 +0000)]
Merge "Add help link to Special:Search"

8 years agoMerge "Convert DjVU cache to WANObjectCache"
jenkins-bot [Wed, 28 Oct 2015 05:30:14 +0000 (05:30 +0000)]
Merge "Convert DjVU cache to WANObjectCache"

8 years agoMerge "Improve WAN cache delete() docs a bit"
jenkins-bot [Wed, 28 Oct 2015 05:26:04 +0000 (05:26 +0000)]
Merge "Improve WAN cache delete() docs a bit"

8 years agoMerge "Bump development Monolog version"
jenkins-bot [Wed, 28 Oct 2015 05:20:05 +0000 (05:20 +0000)]
Merge "Bump development Monolog version"

8 years agoImprove WAN cache delete() docs a bit
Aaron Schulz [Wed, 28 Oct 2015 04:52:30 +0000 (21:52 -0700)]
Improve WAN cache delete() docs a bit

Also use more TTL constants in getWithSetCallback() examples

Change-Id: I866f0464c07fa0c8977c6e908e92186b2ef9de43

8 years agoConvert DjVU cache to WANObjectCache
Aaron Schulz [Mon, 26 Oct 2015 17:43:21 +0000 (10:43 -0700)]
Convert DjVU cache to WANObjectCache

Also unified the total and per page dimensions cache

Change-Id: Ib6ad7c3cdfb4fe3a88d25240c3e362664a9b41fd

8 years agoConvert wfGenerateThumbnail() away from $wgMemc
Aaron Schulz [Wed, 28 Oct 2015 04:40:01 +0000 (21:40 -0700)]
Convert wfGenerateThumbnail() away from $wgMemc

Change-Id: I06c2d90cb3e75142f781afa80f917d4155513a22

8 years agoMerge "objectcache: Introduce IExpiringStore for convenient TTL constants"
jenkins-bot [Wed, 28 Oct 2015 04:31:33 +0000 (04:31 +0000)]
Merge "objectcache: Introduce IExpiringStore for convenient TTL constants"

8 years agoobjectcache: Introduce IExpiringStore for convenient TTL constants
Timo Tijhof [Mon, 19 Oct 2015 17:52:19 +0000 (18:52 +0100)]
objectcache: Introduce IExpiringStore for convenient TTL constants

Also consistently use self:: instead of BagOStuff:: for constants
referenced within the BagOStuff class.

Change-Id: I20fde9fa5cddcc9e92fa6a02b05dc7effa846742

8 years agoresourceloader: Consistently refer to the framework as ResourceLoader
Timo Tijhof [Wed, 28 Oct 2015 03:24:40 +0000 (03:24 +0000)]
resourceloader: Consistently refer to the framework as ResourceLoader

Change-Id: Ia59e4eac9662723e80d62f7cfcb9e4292e3ee4de

8 years agoresourceloader: Remove 'loaderScripts' option from FileModule
Timo Tijhof [Mon, 19 Oct 2015 23:04:23 +0000 (00:04 +0100)]
resourceloader: Remove 'loaderScripts' option from FileModule

Not used in any of our public repositories.

Bug: T65240
Change-Id: I1e9f741c3ef0f922129ecd10039228b58565bf62

8 years agoMerge "set serialize_precision to 17, current PHP default"
jenkins-bot [Wed, 28 Oct 2015 01:52:29 +0000 (01:52 +0000)]
Merge "set serialize_precision to 17, current PHP default"

8 years agoLinksUpdate: Keep track of the triggering User
Kunal Mehta [Tue, 27 Oct 2015 21:49:51 +0000 (14:49 -0700)]
LinksUpdate: Keep track of the triggering User

So extensions like Echo are able to attribute post-edit link updates to
specific the users who triggered them.

Bug: T116485
Change-Id: I083736a174b6bc15e3ce60b2b107c697d0ac13da

8 years agoBump development Monolog version
Bryan Davis [Tue, 27 Oct 2015 22:53:03 +0000 (16:53 -0600)]
Bump development Monolog version

Related mediawiki/vendor change: I6d6db4c

Bug: T116550
Change-Id: I71b2051c4c6193a435183ed00da52e9dc6c0673c

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 27 Oct 2015 20:12:35 +0000 (21:12 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: Ib468dabe3f7d642b58087711945f6026f6d143c8

8 years agoReplace local RunningStat with wikimedia/running-stat library
Ori Livneh [Tue, 27 Oct 2015 18:41:17 +0000 (11:41 -0700)]
Replace local RunningStat with wikimedia/running-stat library

* mediawiki/vendor change: I66b419c8168df.
* Add back-compat shim in includes/compat/RunningStatCompat.php.

Change-Id: Ibad4dc0ce5aa8697791865ed8ea61a25bae7b3e0

8 years agoMerge "Update OOjs UI to v0.13.0"
jenkins-bot [Tue, 27 Oct 2015 18:53:49 +0000 (18:53 +0000)]
Merge "Update OOjs UI to v0.13.0"

8 years agoMake WAN cache HOLDOFF_TTL smaller by combining db/snapshot lag
Aaron Schulz [Sun, 25 Oct 2015 20:42:21 +0000 (13:42 -0700)]
Make WAN cache HOLDOFF_TTL smaller by combining db/snapshot lag

* In the common ~0 second lag case, transactions up to ~7 seconds
  long will have normal set() behavior (instead of just ~5 seconds).
* Like wise with ~0 second transactions tolerating ~7 seconds of
  lag (instead of just ~5).
* The lower hold-off time lets caching resume 3 seconds sooner.

Change-Id: I21e2a0a6915492cec422b6a6af5541937745c15b

8 years agoRestore TitleMoveComplete by-reference flags to avoid errors
Aaron Schulz [Tue, 27 Oct 2015 18:08:17 +0000 (11:08 -0700)]
Restore TitleMoveComplete by-reference flags to avoid errors

They should be removed from extensions, but they don't
really hurt much for now.

Change-Id: I64b570e376062155afdf879c3ce85560127c6792

8 years agoUpdate OOjs UI to v0.13.0
James D. Forrester [Tue, 27 Oct 2015 17:58:23 +0000 (18:58 +0100)]
Update OOjs UI to v0.13.0

Release notes:
 https://git.wikimedia.org/blob/oojs%2Fui.git/v0.13.0/History.md

Change-Id: Ie4f66b15f4f5ec9932d5fd72e12b4453724e3742

8 years agoset serialize_precision to 17, current PHP default
saper [Tue, 27 Oct 2015 17:44:41 +0000 (18:44 +0100)]
set serialize_precision to 17, current PHP default

Follow up to:
https://gerrit.wikimedia.org/r/#/c/249018/

Bug: T116683
Change-Id: I6e8dfab473ae2c18e68c8e4360159c9cc0e09758

8 years agoMerge "Get rid of CSS transitions on form elements in mediawiki.ui"
jenkins-bot [Tue, 27 Oct 2015 17:24:19 +0000 (17:24 +0000)]
Merge "Get rid of CSS transitions on form elements in mediawiki.ui"

8 years agoMerge "Use ImportStringSource for simple import sources"
jenkins-bot [Tue, 27 Oct 2015 15:15:20 +0000 (15:15 +0000)]
Merge "Use ImportStringSource for simple import sources"

8 years agoMerge "Revert "Enforce stricter slave lag limits for bot API requests""
jenkins-bot [Tue, 27 Oct 2015 14:02:14 +0000 (14:02 +0000)]
Merge "Revert "Enforce stricter slave lag limits for bot API requests""

8 years agoRevert "Enforce stricter slave lag limits for bot API requests"
Adrian Lang [Tue, 27 Oct 2015 13:47:38 +0000 (13:47 +0000)]
Revert "Enforce stricter slave lag limits for bot API requests"

This broke most Wikidata API PHPUnit tests.

This reverts commit dc10216e77b06b0fc7bb5e0824eb0967129c2e1f.

Change-Id: I19285ff0eddffb38cdbf45bbd05ba2d8a1816b41

8 years agoMerge "Convert ForeignApiRepo::httpGetCached() to the WAN cache"
jenkins-bot [Tue, 27 Oct 2015 11:21:24 +0000 (11:21 +0000)]
Merge "Convert ForeignApiRepo::httpGetCached() to the WAN cache"

8 years agoMerge "Completely defer EditPage::updateWatchlist"
jenkins-bot [Tue, 27 Oct 2015 11:09:17 +0000 (11:09 +0000)]
Merge "Completely defer EditPage::updateWatchlist"

8 years agoMerge "Make Swift backend respect Content-Type in create/store"
jenkins-bot [Tue, 27 Oct 2015 10:40:11 +0000 (10:40 +0000)]
Merge "Make Swift backend respect Content-Type in create/store"

8 years agoMerge "filebackend: Remove some old Content-Disposition b/c code"
jenkins-bot [Tue, 27 Oct 2015 10:33:05 +0000 (10:33 +0000)]
Merge "filebackend: Remove some old Content-Disposition b/c code"

8 years agoMerge "Enforce stricter slave lag limits for bot API requests"
jenkins-bot [Tue, 27 Oct 2015 10:30:44 +0000 (10:30 +0000)]
Merge "Enforce stricter slave lag limits for bot API requests"

8 years agoMerge "Measure commitMasterChanges() run time"
jenkins-bot [Tue, 27 Oct 2015 10:18:56 +0000 (10:18 +0000)]
Merge "Measure commitMasterChanges() run time"

8 years agoMerge "Protect WAN cache sets() against uncommitted data"
jenkins-bot [Tue, 27 Oct 2015 10:18:52 +0000 (10:18 +0000)]
Merge "Protect WAN cache sets() against uncommitted data"

8 years agoMerge "Fixes related to WikiPage::triggerOpportunisticLinksUpdate()"
jenkins-bot [Tue, 27 Oct 2015 10:07:48 +0000 (10:07 +0000)]
Merge "Fixes related to WikiPage::triggerOpportunisticLinksUpdate()"

8 years agoMerge "Follow-up to Ie3499d"
jenkins-bot [Tue, 27 Oct 2015 09:47:21 +0000 (09:47 +0000)]
Merge "Follow-up to Ie3499d"

8 years agoMerge "resoureloader: Consolidate styles-only queue at the top"
jenkins-bot [Tue, 27 Oct 2015 09:22:44 +0000 (09:22 +0000)]
Merge "resoureloader: Consolidate styles-only queue at the top"

8 years agoFollow-up to Ie3499d
Ori Livneh [Tue, 27 Oct 2015 07:44:47 +0000 (00:44 -0700)]
Follow-up to Ie3499d

My first pass at what became Ie3499d9f2 was to keep the exception for duplicate
registrations with conflicting parameters but downgrade to a warning if the
registration attempts are identically parametrized. I then removed the
exception entirely, but left the if-block, which does not make much sense, as
it means we pass over silently module registrations that set different
parameters, and throw a warning only when they are the same.

Change-Id: I13da33faf2f058ac75ef4b1615c4fafc18f14505

8 years agoMerge "mediawiki.jqueryMsg: Lazy-initialize parsers with getFailableParserFn()"
jenkins-bot [Tue, 27 Oct 2015 05:19:37 +0000 (05:19 +0000)]
Merge "mediawiki.jqueryMsg: Lazy-initialize parsers with getFailableParserFn()"

8 years agoStyling tweaks for inline interwiki search
Erik Bernhardson [Tue, 27 Oct 2015 03:48:07 +0000 (20:48 -0700)]
Styling tweaks for inline interwiki search

To make this look reasonable had to adjust the other styling around
it, I think this now makes more sense too

* moved p tag top margin to .searchresults, the only p tag is at the top
  of search results anyways,
* moved the left margins on every element inside .searchresults
  to .searchresults for consistency
* removed bottom padding from .searchresults p completely, this is
  unnecessary. The top margin of .mw-search-results (.3em) along
  with the bottom margin of generic p tags (.5em) is plenty on its own
* strip the top margin on mw-search-interwiki-header when it comes
  immediatly after .mw-search-nonefound for better spacing to match
  mockup

Bug: T112349
Change-Id: I3dec110e1ac0ab9c3dab1a3f7e6c2b747f2e28c8

8 years agoMerge "mediawiki.jqueryMsg: Remove 'astCache'"
jenkins-bot [Tue, 27 Oct 2015 04:57:01 +0000 (04:57 +0000)]
Merge "mediawiki.jqueryMsg: Remove 'astCache'"

8 years agomediawiki.jqueryMsg: Lazy-initialize parsers with getFailableParserFn()
Bartosz Dziewoński [Fri, 16 Oct 2015 20:17:41 +0000 (22:17 +0200)]
mediawiki.jqueryMsg: Lazy-initialize parsers with getFailableParserFn()

Because they rely on data set by setParserDefaults(), and that is only
called later (from ResourceLoaderJqueryMsgModule).

Bug: T115708
Change-Id: I085d27b1b00873bc5b22573ef7eb9d17b8e5e1fd

8 years agomediawiki.jqueryMsg: Remove 'astCache'
Bartosz Dziewoński [Fri, 16 Oct 2015 20:08:41 +0000 (22:08 +0200)]
mediawiki.jqueryMsg: Remove 'astCache'

All it does is cause problems.

Bug: T54042
Change-Id: I955ee61f6c0040203959ab8f45efb56a32431768

8 years agoregistration: Support custom classes in "ResourceModules" schema
Kunal Mehta [Sun, 2 Aug 2015 23:42:46 +0000 (16:42 -0700)]
registration: Support custom classes in "ResourceModules" schema

Instead of expecting everything to be a ResourceLoaderFileModule, use
the "anyOf" property to validate against multiple schemas. The following
schemas are now allowed:
* The ResourceLoaderFileModule schema, now with the "targets" property
* A schema for ResourceLoaderImageModule
* A generic schema that requires the "class" property is set, but not to
"ResourceLoaderFileModule" or "ResourceLoaderImageModule".

The last schema will allow for any custom ResourceLoaderModule class to
be set in extension.json with arbitrary parameters.

One downside of this is that the error messages shown when a file does
not validate get a little more confusing, as it shows the error messages
for each schema it does not match.

Bug: T105236
Change-Id: I5e4bfa69c733187c7b27294c159cac05b3b92e81

8 years agoMerge "Improve DBReadOnlyError/DBExpectedError page title"
jenkins-bot [Tue, 27 Oct 2015 04:39:02 +0000 (04:39 +0000)]
Merge "Improve DBReadOnlyError/DBExpectedError page title"

8 years agoCompletely defer EditPage::updateWatchlist
Aaron Schulz [Tue, 27 Oct 2015 04:10:54 +0000 (21:10 -0700)]
Completely defer EditPage::updateWatchlist

This should reduce their profile time shown on xenon

Change-Id: I8e92de22755b592cc7b2d3fab36cff2761ab2bb7

8 years agoMerge "Reset serialize_precision to stabilize tests"
jenkins-bot [Tue, 27 Oct 2015 04:07:31 +0000 (04:07 +0000)]
Merge "Reset serialize_precision to stabilize tests"

8 years agoresoureloader: Consolidate styles-only queue at the top
Timo Tijhof [Tue, 27 Oct 2015 03:39:34 +0000 (03:39 +0000)]
resoureloader: Consolidate styles-only queue at the top

This effectively reverts d6b4d3c537 and declines T97420.
This was previously attempted in b7c0e537eb.

Drop support for position "bottom" for addModuleStyles().
This feature was only recently introduced with the intent
to optimise page load performance, but had an adverse effect.

It increases chances of FOUC due to late discovery of these styles.
It also caused minor problems for some gadgets and extensions
that did not or were unable to set these flags. Some mobile
code was introduced around the same time as this feature and
was never given position=top.

Stylesheets that don't affect initial render or are only needed
on interaction should be loaded via addModules() instead; which
is handled by the asynchronous loader in JavaScript.

Change-Id: Ib9821b7b87cfc8a59062bb6ca358974fdb01ced1

8 years agoMerge "Language::truncate(): don't chop up multibyte characters when input contains...
jenkins-bot [Tue, 27 Oct 2015 03:33:15 +0000 (03:33 +0000)]
Merge "Language::truncate(): don't chop up multibyte characters when input contains newlines"

8 years agoGet rid of CSS transitions on form elements in mediawiki.ui
Ori Livneh [Tue, 27 Oct 2015 03:28:21 +0000 (20:28 -0700)]
Get rid of CSS transitions on form elements in mediawiki.ui

They seem to serve no function whatsoever other than to irritate and delay the
loading of the page.

Change-Id: I54c195541713a5bfbc8bd7078499ac49671697c6

8 years agoLanguage::truncate(): don't chop up multibyte characters when input contains newlines
Roan Kattouw [Tue, 27 Oct 2015 03:17:37 +0000 (20:17 -0700)]
Language::truncate(): don't chop up multibyte characters when input contains newlines

To detect whether the truncation had chopped up a multibyte
character after the first byte, a regex was used. But in this
regex, the dot (.) didn't match newlines, so it failed to
detect chopped multibyte characters (after the first byte)
if there was a newline preceding the chopped character.

Bug: T116693
Change-Id: I66e4fd451acac0a1019da7060d5a37d70963a15a

8 years agoMerge "Migrate more callers away from $wgMemc"
jenkins-bot [Tue, 27 Oct 2015 01:44:43 +0000 (01:44 +0000)]
Merge "Migrate more callers away from $wgMemc"

8 years agoMerge "Remove begin/commit transaction calls in refreshLinks.php"
jenkins-bot [Tue, 27 Oct 2015 01:19:42 +0000 (01:19 +0000)]
Merge "Remove begin/commit transaction calls in refreshLinks.php"

8 years agoRemove begin/commit transaction calls in refreshLinks.php
aude [Mon, 26 Oct 2015 21:51:01 +0000 (22:51 +0100)]
Remove begin/commit transaction calls in refreshLinks.php

these sometimes lead to issues with database deadlock loops
and probably are not needed here.

Bug: T75456
Change-Id: Iad03f6076d8e319ff02cb26259ec9705105e92a7

8 years agoMerge "Displaying search results for multiple wikis"
jenkins-bot [Tue, 27 Oct 2015 00:07:27 +0000 (00:07 +0000)]
Merge "Displaying search results for multiple wikis"

8 years agoReset serialize_precision to stabilize tests
saper [Mon, 26 Oct 2015 22:44:48 +0000 (23:44 +0100)]
Reset serialize_precision to stabilize tests

With serialize_precision = 100 the following
failures were generated:

1) ApiFormatPhpTest::testGeneralEncoding with data set #7
(array(1.0E+42), 'a:1:{i:0;d:1.0E+42;}', array(1))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-a:1:{i:0;d:1.0E+42;}
+a:1:{i:0;d:1000000000000000044885712678075916785549312;}

/usr/home/saper/public_html/ybabel/tests/phpunit/includes/api/format/ApiFormatTestBase.php:61
/usr/home/saper/public_html/ybabel/tests/phpunit/MediaWikiTestCase.php:137

2) ApiFormatPhpTest::testGeneralEncoding with data set #30
(array(1.0E+42), 'a:1:{i:0;d:1.0E+42;}', array(2))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-a:1:{i:0;d:1.0E+42;}
+a:1:{i:0;d:1000000000000000044885712678075916785549312;}

/usr/home/saper/public_html/ybabel/tests/phpunit/includes/api/format/ApiFormatTestBase.php:61
/usr/home/saper/public_html/ybabel/tests/phpunit/MediaWikiTestCase.php:137

Bug: T116683
Change-Id: I5e760b4632d2ab326954fe5769476e143c376d7c

8 years agoJavaScriptContentTest: $wgScript != $wgScriptPath
saper [Mon, 26 Oct 2015 22:05:15 +0000 (23:05 +0100)]
JavaScriptContentTest: $wgScript != $wgScriptPath

Set $wgScript, $wgScriptPath and $wgResourceBasePath
to avoid failures when running on a wiki with
a non-standard $wgScriptPath.

Reported-on:

https://lists.wikimedia.org/pipermail/wikitech-l/2015-October/083675.html

Change-Id: I8acbcca5449060ff5604bf275f690b53343e706e

8 years agoImprove DBReadOnlyError/DBExpectedError page title
Aaron Schulz [Sun, 25 Oct 2015 10:40:44 +0000 (03:40 -0700)]
Improve DBReadOnlyError/DBExpectedError page title

Previously it was just "internal error".

Change-Id: I70d81dfc628b462ab525d83f4a20d899da8ca143

8 years agoMerge "LoggerFactory: Only check for Psr\Log\LoggerInterface once"
jenkins-bot [Mon, 26 Oct 2015 19:56:36 +0000 (19:56 +0000)]
Merge "LoggerFactory: Only check for Psr\Log\LoggerInterface once"

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 26 Oct 2015 19:47:23 +0000 (20:47 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I177066ee20e6c31810845cadf7ce6fef9d2ad1ce

8 years agoMerge "Convert doDeleteArticleReal to startAtomic()/endAtomic()"
jenkins-bot [Mon, 26 Oct 2015 19:23:52 +0000 (19:23 +0000)]
Merge "Convert doDeleteArticleReal to startAtomic()/endAtomic()"

8 years agoMerge "Convert MovePage to startAtomic()/endAtomic()"
jenkins-bot [Mon, 26 Oct 2015 19:14:59 +0000 (19:14 +0000)]
Merge "Convert MovePage to startAtomic()/endAtomic()"

8 years agoMerge "PrefixSearch: avoid looking for titles that don't exist"
jenkins-bot [Mon, 26 Oct 2015 19:13:01 +0000 (19:13 +0000)]
Merge "PrefixSearch: avoid looking for titles that don't exist"

8 years agoConvert doDeleteArticleReal to startAtomic()/endAtomic()
Aaron Schulz [Wed, 7 Oct 2015 18:48:23 +0000 (11:48 -0700)]
Convert doDeleteArticleReal to startAtomic()/endAtomic()

* They no longer commit the update, but just make sure
  it is part of a transaction. The BEGIN/COMMIT will
  happen at request start/end given DBO_TRX or in this
  method otherwise (like when in CLI mode). This avoids
  premature committing of other transactions.
* FileDeleteForm was the only caller using $commit=false
  for WikiPage::doDeleteArticleReal() and its proxies
  WikiPage::doDeleteArticle() and Article::doDeleteArticle().
  The ugly $commit flag is now removed.
* No caller was using $id for WikiPage::doDeleteArticleReal()
  and its proxies WikiPage::doDeleteArticle() and
  Article::doDeleteArticle(). It is now removed and we can
  be sure the lock() and CAS logic always hit in the method.
  The rollback() calls are not needed given the page row lock
  and having them there could break outer transactions.
* Updated FileDeleteForm to use startAtomic()/endAtomic() so
  the article and file delete are still wrapped in a
  transaction. Note that LocalFile::delete() does reference
  counting and trxLevel() checks so it will not try to begin()
  and break FileDeleteForm's transaction via startAtomic().
* Moved less important 'page-recent-delete' key update down
  for sanity in case it blows up.

Change-Id: Idb98510506c0edd02236c30badaec97d86e07696

8 years agoMigrate more callers away from $wgMemc
Aaron Schulz [Mon, 26 Oct 2015 07:41:05 +0000 (00:41 -0700)]
Migrate more callers away from $wgMemc

Callers should use more expliciy lazy-loaded
cache factory methods.

Change-Id: Ifa0bf389720a09a931ee6466b993f787d83a09a7

8 years agoMerge "Update grunt-jsonlint to 1.0.5"
jenkins-bot [Mon, 26 Oct 2015 19:05:18 +0000 (19:05 +0000)]
Merge "Update grunt-jsonlint to 1.0.5"

8 years agoMerge "ApiBase::PARAM_DFLT => null is the default anyway"
jenkins-bot [Mon, 26 Oct 2015 19:02:33 +0000 (19:02 +0000)]
Merge "ApiBase::PARAM_DFLT => null is the default anyway"

8 years agoLoggerFactory: Only check for Psr\Log\LoggerInterface once
Bryan Davis [Sat, 24 Oct 2015 22:05:21 +0000 (16:05 -0600)]
LoggerFactory: Only check for Psr\Log\LoggerInterface once

LoggerFactory::getInstance() will be called many times during the course
of handling a typical MediaWiki request. The interface_exists() guard
condition it uses is an attempt to provide an informative error message
when Composer managed libraries are not installed. This check is only
needed on the first invocation of getInstance() to be effective. Using
an additional boolean to guard the interface_exists() call will allow
the PHP runtime to avoid a potentially expensive (at least compared to
a static boolean comparison) function call.

This is the sort of thing that smells of premature optimization, but its
addition is in fact informed by examination of performance reports from
the Wikimedia production environment.

Bug: T115729
Change-Id: I437bcb5326b06145081f2b86f6c4d0c8dc1a318c

8 years agoPrefixSearch: avoid looking for titles that don't exist
Chad Horohoe [Mon, 26 Oct 2015 18:50:23 +0000 (11:50 -0700)]
PrefixSearch: avoid looking for titles that don't exist

WikiPage::getRedirectTarget() can very easily return null. Don't
blow up when that happens.

Properly document PrefixSearch::getRedirectTarget() while we're
here.

Bug: T116029
Change-Id: Ib509e8e3e6ec04a787de3857a4b5ee9b01560559

8 years agoresourceloader: Deduplicate module registration conflicts
Ori Livneh [Mon, 26 Oct 2015 18:23:43 +0000 (11:23 -0700)]
resourceloader: Deduplicate module registration conflicts

If an attempt is made to register a ResourceLoader module which has already
been registered, instead of bailing with an error, issue a warning instead, and
allow the lattermost set of module parameters to stick.

Because modules are registered from extensions, and because modules are often
migrated from one extension to another as extensions are refactored, and
because the developers of different extensions are not always aware of each
other's work, throwing an error runs a high risk of causing an outage.

Bug: T116628
Change-Id: Ie3499d9f2ff3bf071f1c2b0176e19440ff55211c

8 years agofilebackend: Remove some old Content-Disposition b/c code
Aaron Schulz [Mon, 26 Oct 2015 18:13:58 +0000 (11:13 -0700)]
filebackend: Remove some old Content-Disposition b/c code

Change-Id: I6af4a84bd549e2bfb1b110fa790f499d144f236b

8 years agoMake Swift backend respect Content-Type in create/store
Aaron Schulz [Mon, 26 Oct 2015 18:16:18 +0000 (11:16 -0700)]
Make Swift backend respect Content-Type in create/store

Change-Id: I479d1fc4f261bdcdc380404db0cb2f2397877759

8 years agoMerge "Make DateFormatter::getInstance use APC"
jenkins-bot [Mon, 26 Oct 2015 17:46:53 +0000 (17:46 +0000)]
Merge "Make DateFormatter::getInstance use APC"