lhc/web/wiklou.git
7 years agoLogPager: Use normalized value for log_user_text in query condition
Glaisher [Sat, 13 Aug 2016 12:02:03 +0000 (17:02 +0500)]
LogPager: Use normalized value for log_user_text in query condition

Bug: T142755
Change-Id: Ia08be456cafa2133e5ea0e521161d6939e839fb2

7 years agoMerge "Make DeferredUpdates able to run DataUpdates"
jenkins-bot [Fri, 2 Sep 2016 04:48:35 +0000 (04:48 +0000)]
Merge "Make DeferredUpdates able to run DataUpdates"

7 years agoMerge "ImageHistoryList: Remove 'wpEditToken' parameter from the "revert" link for...
jenkins-bot [Fri, 2 Sep 2016 04:43:41 +0000 (04:43 +0000)]
Merge "ImageHistoryList: Remove 'wpEditToken' parameter from the "revert" link for files"

7 years agoMake DeferredUpdates able to run DataUpdates
Aaron Schulz [Sun, 28 Aug 2016 16:23:52 +0000 (09:23 -0700)]
Make DeferredUpdates able to run DataUpdates

* Also make ErrorPageError exceptions display themselves
  in PRESEND mode. Before they were always suppressed.
* Make DataUpdate::runUpdates() simply wrap
  DeferredUpdates::execute().
* Remove unused installDBListener() method, which was
  basically moved to Maintenance.
* Enable DBO_TRX for DeferredUpdates::execute() in CLI mode
* Also perform sub-DeferrableUpdate jobs right after their
  parent for better transaction locality.
* Made rollbackMasterChangesAndLog() clear all master
  transactions/rounds, even if there are no changes yet.
  This keeps the state cleaner for continuing.
* For sanity, avoid calling acquirePageLock() in link updates
  unless the transaction ticket is set. These locks are
  already redundant and weaker in range than the locks the
  Job classes that run them get. This helps guard against
  DBTransactionError.
* Renamed $type to $stage to be more clear about the order.

Change-Id: I1e90b56cc80041d70fb9158ac4f027285ad0f2c9

7 years agoMove run-on-add logic in DeferredUpdates to addUpdate()
Aaron Schulz [Thu, 1 Sep 2016 17:03:31 +0000 (10:03 -0700)]
Move run-on-add logic in DeferredUpdates to addUpdate()

Change-Id: I1b3ec21e07549f7250fa497f352fe1c131ddc88a

7 years agoRemove $recursionGuard var from tryOpportunisticExecute()
Aaron Schulz [Thu, 1 Sep 2016 17:01:25 +0000 (10:01 -0700)]
Remove $recursionGuard var from tryOpportunisticExecute()

Aside from there being no idle callback setting here, the
old addUpdate() code that runs updates allows nesting updates.
Make this support that for a few transitional commits. It will
be changed later to simply order the sub-updates after their
parent updates, keeping both outer scope for all updates and
locality of related updates.

Change-Id: I0ad4e9713a7893b981b7bb013e9db803eed663b2

7 years agoSet "run when DBs idle" DeferredUpdates logic in Maintenance
Aaron Schulz [Thu, 1 Sep 2016 16:43:01 +0000 (09:43 -0700)]
Set "run when DBs idle" DeferredUpdates logic in Maintenance

* This is a more robust version of the one inside
  DeferredUpdates (checking all DBs), which will be
  replaced in a later commit.
* Make sure the listener is restored when the LB gets
  torn down in tests. Also, it should respect the
  $wgCommandLineMode value as tests can change it.

Change-Id: I1e3faa5a058df44e2d27ab5ac185930867eb68ac

7 years agoRemove unused custom transaction logic from DataUpdate
Aaron Schulz [Thu, 1 Sep 2016 00:03:39 +0000 (17:03 -0700)]
Remove unused custom transaction logic from DataUpdate

Change-Id: Ife65e4e90a35395e87f4f487f1cb871b67d92aa1

7 years agoSet some missing INTERNAL DB transaction flags and add wfWarn() calls
Aaron Schulz [Thu, 1 Sep 2016 12:10:48 +0000 (05:10 -0700)]
Set some missing INTERNAL DB transaction flags and add wfWarn() calls

Make TRANSACTION_INTERNAL set mTrxAutomatic rather that
having callers have to do that individually.

The warnings should actually make tests fail with backtraces,
rather than often just having wrong things happen later.

Change-Id: Ic247a7b42a686f170f7abe6ec584459f3db4ed69

7 years agoImageHistoryList: Remove 'wpEditToken' parameter from the "revert" link for files
Bartosz Dziewoński [Thu, 1 Sep 2016 20:59:55 +0000 (22:59 +0200)]
ImageHistoryList: Remove 'wpEditToken' parameter from the "revert" link for files

The action=revert page does not use this parameter at all. (It displays
a form with an entirely different token.) I think this has not been
needed since cf6dd13faca23af5b6e3188445b84e05d620d499 (r91284).

Change-Id: Ice5ecd2606a94a70321ede5304fee77fb1fb06c1

7 years agoMerge "objectcache: allow for callbacks to mask SYNC_WRITE latency"
jenkins-bot [Thu, 1 Sep 2016 21:38:21 +0000 (21:38 +0000)]
Merge "objectcache: allow for callbacks to mask SYNC_WRITE latency"

7 years agoobjectcache: allow for callbacks to mask SYNC_WRITE latency
Aaron Schulz [Mon, 29 Aug 2016 17:00:05 +0000 (10:00 -0700)]
objectcache: allow for callbacks to mask SYNC_WRITE latency

Change-Id: I908222ad3788ebe330aa58831cda139da32becd8

7 years agoMerge "Register a default value for the timecorrection preference"
jenkins-bot [Thu, 1 Sep 2016 20:33:50 +0000 (20:33 +0000)]
Merge "Register a default value for the timecorrection preference"

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 1 Sep 2016 20:08:52 +0000 (22:08 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ib4393e8374d2b6596a461934e7a5a0f15a88e292

7 years agoMerge "Remove SourceIndexField FLAG_SOURCE_DATA"
jenkins-bot [Thu, 1 Sep 2016 18:59:55 +0000 (18:59 +0000)]
Merge "Remove SourceIndexField FLAG_SOURCE_DATA"

7 years agoRemove SourceIndexField FLAG_SOURCE_DATA
dcausse [Thu, 1 Sep 2016 15:00:59 +0000 (17:00 +0200)]
Remove SourceIndexField FLAG_SOURCE_DATA

Change-Id: I080f06a5a09f2d67a153b491555d0dbf65c626d0

7 years agoMerge "Add DEFAULTSORT to search index field data"
jenkins-bot [Thu, 1 Sep 2016 14:51:41 +0000 (14:51 +0000)]
Merge "Add DEFAULTSORT to search index field data"

7 years agoMerge "mediawiki.util: Remove deprecated tooltipAccessKeyPrefix/tooltipAccessKeyRegexp"
jenkins-bot [Thu, 1 Sep 2016 10:52:22 +0000 (10:52 +0000)]
Merge "mediawiki.util: Remove deprecated tooltipAccessKeyPrefix/tooltipAccessKeyRegexp"

7 years agoMerge "Use transaction listener to run DeferredUpdates in CLI mode"
jenkins-bot [Thu, 1 Sep 2016 06:45:00 +0000 (06:45 +0000)]
Merge "Use transaction listener to run DeferredUpdates in CLI mode"

7 years agoMerge "Add LoadBalancer::setTransactionListener()"
jenkins-bot [Thu, 1 Sep 2016 06:42:46 +0000 (06:42 +0000)]
Merge "Add LoadBalancer::setTransactionListener()"

7 years agoUse transaction listener to run DeferredUpdates in CLI mode
Aaron Schulz [Sun, 28 Aug 2016 16:06:57 +0000 (09:06 -0700)]
Use transaction listener to run DeferredUpdates in CLI mode

This sets triggers on master position waits typically called
after commitMasterChanges() or in commitAndWaitForReplication().

Change-Id: I127a8fe3cfc319abfa84fcd221ee2dae191c6d3b

7 years agomediawiki.util: Remove deprecated tooltipAccessKeyPrefix/tooltipAccessKeyRegexp
Timo Tijhof [Sat, 27 Aug 2016 22:36:59 +0000 (15:36 -0700)]
mediawiki.util: Remove deprecated tooltipAccessKeyPrefix/tooltipAccessKeyRegexp

* Deprecated since MediaWiki 1.24.
* No longer used anywhere in Wikimedia Git.
* No longer used anywhere in MediaWiki-namespace on Wikimedia wikis.

Fixes performance issue uncovered in T144070. Would otherwise have
been addressed through a getter of sorts.

Change-Id: Ib323b7a63c5a2e8d36c5f105d0554a7216339b07

7 years agoMerge "Convert LocalFile to using getWithSetCallback() for caching"
jenkins-bot [Thu, 1 Sep 2016 01:55:11 +0000 (01:55 +0000)]
Merge "Convert LocalFile to using getWithSetCallback() for caching"

7 years agoMerge "bidi-isolate usernames in Linker::userLink"
jenkins-bot [Thu, 1 Sep 2016 01:11:19 +0000 (01:11 +0000)]
Merge "bidi-isolate usernames in Linker::userLink"

7 years agoMerge "ApiParamInfo: Allow fetching info for all submodules of a module"
jenkins-bot [Thu, 1 Sep 2016 00:56:19 +0000 (00:56 +0000)]
Merge "ApiParamInfo: Allow fetching info for all submodules of a module"

7 years agobidi-isolate usernames in Linker::userLink
Moriel Schottlender [Wed, 31 Aug 2016 20:58:05 +0000 (13:58 -0700)]
bidi-isolate usernames in Linker::userLink

Usernames can be in any script/language and include weak and neutral
characters like parentheses and dashes - these flip and make things
look very weird when displayed in the opposite directionality.

This fix adds <bdi> tags to isolate the username when we output user
links. This will affect displays like user personal tools, history
and diff view.

Also, fixing LogFormatterTestCase::removeSomeHtml() that expected
a very rigid html input (and thus failed with the new <bdi> wrapping)
to use strip_tags() instead.

Change-Id: I2db5f4b7d3a00726461eb6b699fbdf0ecd47a1cb

7 years agoAdd LoadBalancer::setTransactionListener()
Aaron Schulz [Sun, 28 Aug 2016 15:56:17 +0000 (08:56 -0700)]
Add LoadBalancer::setTransactionListener()

This is useful for setting callbacks without making a new
DB connection. It also catches extra connections due to
foriegn wiki usage.

Change-Id: Ief009a0c1c2b4245fe3594fdf0d306dcc4956151

7 years agoConvert LocalFile to using getWithSetCallback() for caching
Aaron Schulz [Tue, 30 Aug 2016 06:22:22 +0000 (23:22 -0700)]
Convert LocalFile to using getWithSetCallback() for caching

Changed the hashing for the keys to SHA-1, which also avoids
problems with old MediaWiki versions seeing the new WAN
versioned keys.

Also fixed a few annoying IDEA errors

Change-Id: Ie608fb86421bc96e05e4a3b352f39b4938a243e4

7 years agoDeprecate SqlDataUpdate
Aaron Schulz [Wed, 31 Aug 2016 13:24:12 +0000 (06:24 -0700)]
Deprecate SqlDataUpdate

Core subclasses have been updated.

Change-Id: Ic1beebeb7aec2b40d89c75637968e57e71a6c1a2

7 years agoMerge "Links update class cleanups"
jenkins-bot [Thu, 1 Sep 2016 00:25:09 +0000 (00:25 +0000)]
Merge "Links update class cleanups"

7 years agoLinks update class cleanups
Aaron Schulz [Wed, 31 Aug 2016 13:06:35 +0000 (06:06 -0700)]
Links update class cleanups

* Avoid using deprecated functions.
* Switch to DataUpdate as the direct parent class as
  no benefit was provided from SqlDataUpdate (which
  should be deprecated soon).

Change-Id: I0f1c77128f3df658e6a0eaf4471ca48ac536c643

7 years agoMerge "Improve beginMasterChanges and make methods for DeferredUpdates"
jenkins-bot [Wed, 31 Aug 2016 23:44:01 +0000 (23:44 +0000)]
Merge "Improve beginMasterChanges and make methods for DeferredUpdates"

7 years agoImprove beginMasterChanges and make methods for DeferredUpdates
Aaron Schulz [Fri, 26 Aug 2016 07:19:34 +0000 (00:19 -0700)]
Improve beginMasterChanges and make methods for DeferredUpdates

* Fixed bug in LBFactory::beginMasterChanges where
  untracked DBs that then get written to where not in the
  transaction round. The call to onTransactionResolution()
  right after commit() was also problematic, so a flag was
  added to handle that.
* Add LBFactory::setWaitForReplicationListener(), which
  fires at what is often a good point to run deferred updates.
* Add DatabaseBase::clearSnapshot() for committing no-op
  transactions.
* Add IDatabase::setTransactionListener() for persistent
  callbacks. Monitoring commits can be used to find a point
  where deferred updates can run.
* Follow-up commit will address DeferredUpdates.

Change-Id: I4589e6f3ae40b1c362601416db48857fb89840bf

7 years agoMerge "Use wiki email for From of CC messages when $wgUserEmailUseReplyTo is set"
jenkins-bot [Wed, 31 Aug 2016 20:28:48 +0000 (20:28 +0000)]
Merge "Use wiki email for From of CC messages when $wgUserEmailUseReplyTo is set"

7 years agoUse wiki email for From of CC messages when $wgUserEmailUseReplyTo is set
Bryan Davis [Sat, 13 Feb 2016 23:33:08 +0000 (16:33 -0700)]
Use wiki email for From of CC messages when $wgUserEmailUseReplyTo is set

Avoid bounces caused by SPF protections when sending CC messages to
users. This mirrors the logic used when sending the original message.

Change-Id: I1c48892e9b5086fd564eedd65cca6a848a2b425c

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 31 Aug 2016 19:57:45 +0000 (21:57 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I94ec22fbff6255c613997c008e185def799495ad

7 years agoMerge "Enable jquery.ui.position on mobile"
jenkins-bot [Wed, 31 Aug 2016 19:41:05 +0000 (19:41 +0000)]
Merge "Enable jquery.ui.position on mobile"

7 years agoApiParamInfo: Allow fetching info for all submodules of a module
Brad Jorsch [Wed, 31 Aug 2016 19:18:26 +0000 (15:18 -0400)]
ApiParamInfo: Allow fetching info for all submodules of a module

This allows fetching info for all query submodules with modules=query+*,
and info for all modules recursively with modules=main|main+**.

Bug: T28680
Change-Id: Icca5d2fda39d9d43fe20d77e34779412cec77aad

7 years agoMerge "ApiQueryAllDeletedRevisions: More namespace handling fixes"
jenkins-bot [Wed, 31 Aug 2016 19:12:57 +0000 (19:12 +0000)]
Merge "ApiQueryAllDeletedRevisions: More namespace handling fixes"

7 years agoMerge "Always fail over to sync jobs when Special:RunJobs fails"
jenkins-bot [Wed, 31 Aug 2016 17:53:20 +0000 (17:53 +0000)]
Merge "Always fail over to sync jobs when Special:RunJobs fails"

7 years agoMerge "Adapt the ParserOutput cache TTL when including special pages"
jenkins-bot [Wed, 31 Aug 2016 17:40:05 +0000 (17:40 +0000)]
Merge "Adapt the ParserOutput cache TTL when including special pages"

7 years agoApiQueryAllDeletedRevisions: More namespace handling fixes
Brad Jorsch [Wed, 31 Aug 2016 17:19:13 +0000 (13:19 -0400)]
ApiQueryAllDeletedRevisions: More namespace handling fixes

* If the user specifically requests an empty list of namespaces, they
  should get no pages.
* `ar_namespace` should always be in the query so MySQL can do a range
  search instead of a full index scan.
* The example provided didn't match its description.

Bug: T89665
Change-Id: I91afc25db488f75c7f2b1ef343766b4bd7da5472

7 years agoAdapt the ParserOutput cache TTL when including special pages
Aaron Schulz [Tue, 30 Aug 2016 19:35:08 +0000 (12:35 -0700)]
Adapt the ParserOutput cache TTL when including special pages

For simple pages that transclude special pages, like user pages
including Special:PrefixIndex, the TTL is allowed to drop to 15
seconds if the page parses fast enough.

Bug: T139893
Change-Id: If41885ded648d68352fe3d06336d98aa0ab53966

7 years agoEnable jquery.ui.position on mobile
jdlrobson [Wed, 31 Aug 2016 15:17:07 +0000 (08:17 -0700)]
Enable jquery.ui.position on mobile

Although this module is deprecated it appears to be used in isolation
from jquery.ui in key extensions such as Translate. To aid extensions
who need to transition away from it we should make this available on mobile.

This module does not appear to be loaded on startup and is the only
non-mobile targetted module used by the Translate extension so enabling
this will give us benefit.

This also fits in with the long term plan
of deprecating the targets field altogether.

Change-Id: Ib381b820c69832f9aa6fce01f5dae8b4f50d66fa

7 years agoAlways fail over to sync jobs when Special:RunJobs fails
Aaron Schulz [Wed, 31 Aug 2016 12:24:02 +0000 (05:24 -0700)]
Always fail over to sync jobs when Special:RunJobs fails

This makes sure that jobs run one way or another.

Also made a few cleanups and improved the logging.

Change-Id: Ic2916099181ebeb5ae5143d444515db9ed13cee9

7 years agoMediaWikiServices: Import NoSuchServiceException
Sam Smith [Wed, 31 Aug 2016 10:46:02 +0000 (11:46 +0100)]
MediaWikiServices: Import NoSuchServiceException

NoSuchServiceException is in the MediaWiki\Services namespace. Since the
MediaWikiServices class is in the MediaWiki namespace, the

  catch ( NoSuchServiceException $e )

line added in Ifc587d61 will fail to catch any exception.

Co-Author: Paladox <thomasmulhall410@yahoo.com>
Bug: T143974
Change-Id: I903336c85c0bb9fb259f475f37959136e2ff7eca

7 years agoobjectcache: add and use adaptiveTTL() method
Aaron Schulz [Sun, 21 Aug 2016 21:53:55 +0000 (14:53 -0700)]
objectcache: add and use adaptiveTTL() method

* This better handles delayed/lost cache purges by
  having lower TTLs for entries that often changes.
* Use this for foreign upload description page caches,
  we purges are never received from the source wiki.
* Also use this for User and LocalFile cache TTLs.
* Also move the Database::getCacheSetOptions() call in
  User *before* doing the queries, which is preferred.
* Fixed some IDEA errors too, like the undeclared
  mApiBase field.

Change-Id: I70f8ebb29ac853c2a530d9eedb9e7facc1b7b710

7 years agoMerge "mw.loader: Use requestAnimationFrame for addEmbeddedCSS()"
jenkins-bot [Wed, 31 Aug 2016 01:53:58 +0000 (01:53 +0000)]
Merge "mw.loader: Use requestAnimationFrame for addEmbeddedCSS()"

7 years agoMerge "mw.loader: Make 'mwLoadEnd' less expensive with a single using()"
jenkins-bot [Wed, 31 Aug 2016 01:52:31 +0000 (01:52 +0000)]
Merge "mw.loader: Make 'mwLoadEnd' less expensive with a single using()"

7 years agomw.loader: Use requestAnimationFrame for addEmbeddedCSS()
Timo Tijhof [Tue, 30 Aug 2016 04:07:52 +0000 (21:07 -0700)]
mw.loader: Use requestAnimationFrame for addEmbeddedCSS()

setTimeout is fairly inefficient for this purpose as it tends to schedule for
further in the future than rAF would. And even then, it happens at a bad time
for the browser with regards to style changes.

Instead, use rAF, which typically executes earlier and at the point where the
browser is expecting style changes.

This makes top and bottom modules finish execution earlier by having their
styles applied sooner.

Change-Id: Ie4e7464aa811fa8ea4e4f115696f0bddbd28737b

7 years agomw.loader: Make 'mwLoadEnd' less expensive with a single using()
Timo Tijhof [Fri, 26 Aug 2016 04:51:01 +0000 (21:51 -0700)]
mw.loader: Make 'mwLoadEnd' less expensive with a single using()

20-30ms before this patch, ~2ms after this patch (MacBookPro, Chrome 52).

The creation of 100s of Deferred objects, $.when() tracking them
all, and bubbling up the completion took 20-30ms. This is quite
expensive. Optimise by using a single deferred first.
A module reaching state 'missing' or 'error' is very rare.

Change-Id: I90eea4bfe8fe6d85c395d9d0868bbde482c4a703

7 years agomw.Title: Correct handling of Unicode whitespace and bidi control characters
Bartosz Dziewoński [Wed, 24 Aug 2016 19:33:45 +0000 (21:33 +0200)]
mw.Title: Correct handling of Unicode whitespace and bidi control characters

MediaWiki titles may not contain Unicode bidi control characters, e.g.
U+200E LEFT-TO-RIGHT MARK. They are silently stripped and such a
title is considered valid.

MediaWiki titles may not contain any whitespace other than a regular
space. Most of them are silently replaced with a regular space and
such a title is considered valid, but there are some (e.g. the tab
character) which make the title invalid. I'm not sure if this is an
intentional behavior, but I added a test case to verify it.

Bug: T143759
Change-Id: If8fad1f896027c5d93a62b0785923a39136c6a36

7 years agoMerge "objectcache: Make SqlBagOStuff::waitForSlaves() no-op without slaves"
jenkins-bot [Tue, 30 Aug 2016 22:54:23 +0000 (22:54 +0000)]
Merge "objectcache: Make SqlBagOStuff::waitForSlaves() no-op without slaves"

7 years agoobjectcache: Make SqlBagOStuff::waitForSlaves() no-op without slaves
Aaron Schulz [Tue, 30 Aug 2016 22:32:09 +0000 (15:32 -0700)]
objectcache: Make SqlBagOStuff::waitForSlaves() no-op without slaves

Change-Id: Ibaa4745c18c6f4f66edb4c5f190196b575d3b738

7 years agoMerge "Add more estimation modes to pendingWriteQueryDuration()"
jenkins-bot [Tue, 30 Aug 2016 21:44:54 +0000 (21:44 +0000)]
Merge "Add more estimation modes to pendingWriteQueryDuration()"

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 30 Aug 2016 20:04:17 +0000 (22:04 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I197f28fb1bb4507234a7f534160f017db2476598

7 years agoMerge "Expand SessionManager / AuthManager documentation"
jenkins-bot [Tue, 30 Aug 2016 19:11:13 +0000 (19:11 +0000)]
Merge "Expand SessionManager / AuthManager documentation"

7 years agoExpand SessionManager / AuthManager documentation
Gergő Tisza [Sat, 27 Aug 2016 05:40:37 +0000 (05:40 +0000)]
Expand SessionManager / AuthManager documentation

Bug: T110628
Bug: T142154
Change-Id: Ib0a41f01b3d12267b2a94ea1375e6d13cacd2b69

7 years agoMerge "mw.api.messages: Allow passing extra parameters for the API call"
jenkins-bot [Tue, 30 Aug 2016 17:30:47 +0000 (17:30 +0000)]
Merge "mw.api.messages: Allow passing extra parameters for the API call"

7 years agomw.api.messages: Allow passing extra parameters for the API call
Bartosz Dziewoński [Tue, 30 Aug 2016 16:18:39 +0000 (18:18 +0200)]
mw.api.messages: Allow passing extra parameters for the API call

Mostly I want to pass `amenableparser: true`.

Bug: T144237
Change-Id: I7e1a52a59a25befe4edb7b4f531d60a2615e8f90

7 years agomediawiki.toc: Simplify function toggleToc call
Fomafix [Tue, 30 Aug 2016 10:37:41 +0000 (12:37 +0200)]
mediawiki.toc: Simplify function toggleToc call

Change-Id: Ib74b217a265cf17acf72cf8b75d5a751531755a0

7 years agoMerge "mediawiki.toc: Simplify ternary operator"
jenkins-bot [Tue, 30 Aug 2016 14:51:20 +0000 (14:51 +0000)]
Merge "mediawiki.toc: Simplify ternary operator"

7 years agoMerge "MediaWikiServices: Don't assume, that old and new instances contains the same...
jenkins-bot [Tue, 30 Aug 2016 14:31:14 +0000 (14:31 +0000)]
Merge "MediaWikiServices: Don't assume, that old and new instances contains the same services"

7 years agoMediaWikiServices: Don't assume, that old and new instances contains the same services
Florian Schmidt [Sun, 28 Aug 2016 16:33:40 +0000 (18:33 +0200)]
MediaWikiServices: Don't assume, that old and new instances contains the same services

As the services, that are registered in MediaWikiServices can be changed by
extensions using the MediaWikiServices hook, it's not save to assume, that
the first created instance of MediaWikiServices (which could be created before
any extension is loaded, e.g. in ExtensionRegistry) contains the same services
as a later created one (in the reset process of resetGlobalInstance). Doing this
could result in a NoSuchServiceException, if an extension registers new services,
which aren't registered before the extension is loaded (as, in the reset process,
MediaWikiServices tries to minimize the service instantiation cost by preserving
services, that can be preserved).

This patch adds a check, if a service is registered in the MediaWikiServices object
that should be reset, before the salvage-logic tries to fetch the services. If the
service object does not exist, it simply skips it, as it will simply instantiated
later.

Follow up: Ie2ca3ff99aa74fffa9eb6c8faccab857dc0874f7
Follow up: I2a26b6af07a48ad15414a8428daa9cfcfe02e933

Bug: T143974
Change-Id: Ifc587d6138ab565c2f38eb0805acf0dd0473d433

7 years agoRevert serie of "EditPage: Use context instead of globals"
Antoine Musso [Tue, 30 Aug 2016 12:46:38 +0000 (14:46 +0200)]
Revert serie of "EditPage: Use context instead of globals"

Reverts:

89cade EditPage: Use context instead of globals (4/4)
27fd110 EditPage: Use context instead of globals (3/4)
afa6307 EditPage: Use context instead of globals (2/4)
f2f8101 EditPage: Use context instead of globals (1/4)

LiquidThreads is still using globals when invoking EditPage. That can be
reproduced by attempting to reply to a message which eventually causes
EditPage::importFormData() to errors out with:

ErrorPageError from includes/EditPage.php:
The content format json is not supported by the content model wikitexte.

Bug: T143889
Change-Id: I593450971e4a4a31c88df49334859508d1fd006c

7 years agoRevert "EditPage: Use context instead of globals (1/4)"
Antoine Musso [Tue, 30 Aug 2016 12:36:43 +0000 (14:36 +0200)]
Revert "EditPage: Use context instead of globals (1/4)"

This reverts commit f2f810181aa4188053da2af94faa6e3bad33d1a3.

Change-Id: Ia0267204522168ba7e74f4a732af12da6113bf69

7 years agoRevert "EditPage: Use context instead of globals (2/4)"
Antoine Musso [Tue, 30 Aug 2016 12:36:46 +0000 (14:36 +0200)]
Revert "EditPage: Use context instead of globals (2/4)"

This reverts commit afa630749a393114a5df0921f75590a8ca189c91.

Change-Id: I721d0ecc5462fd17fd016f83471218a53cd0f75b

7 years agoRevert "EditPage: Use context instead of globals (3/4)"
Antoine Musso [Tue, 30 Aug 2016 12:36:47 +0000 (14:36 +0200)]
Revert "EditPage: Use context instead of globals (3/4)"

This reverts commit 27fd11095213eaf2b3b5d2e21a93b6ee03c3b004.

Change-Id: I23480a49d69fbede292a1d41f1c5e783b6366852

7 years agoRevert "EditPage: Use context instead of globals (4/4)"
Antoine Musso [Tue, 30 Aug 2016 12:36:48 +0000 (14:36 +0200)]
Revert "EditPage: Use context instead of globals (4/4)"

This reverts commit 589cadedf31787e75c9f83b3c4f05c79397dd4cc.

Change-Id: I4022ab93ca9bb3e41f1f563c4e919d8f3e4cb18f

7 years agomediawiki.toc: Simplify ternary operator
Fomafix [Tue, 30 Aug 2016 11:47:11 +0000 (13:47 +0200)]
mediawiki.toc: Simplify ternary operator

Change-Id: Ie315fb5c520c44e1f95bd96ec95bb46c09c93b36

7 years agoMerge "Invalidate cache when page language is changed"
jenkins-bot [Tue, 30 Aug 2016 06:07:33 +0000 (06:07 +0000)]
Merge "Invalidate cache when page language is changed"

7 years agoMerge "mw.widgets.CategoryCapsuleItemWidget: Handle titles not normalized in JS code"
jenkins-bot [Tue, 30 Aug 2016 02:03:42 +0000 (02:03 +0000)]
Merge "mw.widgets.CategoryCapsuleItemWidget: Handle titles not normalized in JS code"

7 years agoMerge "API: Warn when input parameters are normalized"
jenkins-bot [Tue, 30 Aug 2016 01:46:36 +0000 (01:46 +0000)]
Merge "API: Warn when input parameters are normalized"

7 years agoMerge "API: Use U+001F (Unit Separator) for separating multi-valued parameters"
jenkins-bot [Tue, 30 Aug 2016 01:45:03 +0000 (01:45 +0000)]
Merge "API: Use U+001F (Unit Separator) for separating multi-valued parameters"

7 years agomw.widgets.CategoryCapsuleItemWidget: Handle titles not normalized in JS code
Bartosz Dziewoński [Wed, 24 Aug 2016 20:21:42 +0000 (22:21 +0200)]
mw.widgets.CategoryCapsuleItemWidget: Handle titles not normalized in JS code

Bug: T139130
Change-Id: If20941fb381a01aab01b971e1093a53b76c96f66

7 years agoAdd more estimation modes to pendingWriteQueryDuration()
Aaron Schulz [Sat, 27 Aug 2016 10:57:26 +0000 (03:57 -0700)]
Add more estimation modes to pendingWriteQueryDuration()

* Use this to exclude some common cases of harmless queries that
  happen to block on row-level locks for a long time. This does
  not apply to UPDATE/DELETE however, due to the ambiguity of
  time spent scanning vs locking.
* Update commitMasterChanges() and JobRunner to use the new
  mode to avoid pointless rollback or lag checks.

Change-Id: Ifc2743f2d8cd109840c45cda5028fbb4df55d231

7 years agoMerge "Include PRESEND updates in ChronologyProtector positions"
jenkins-bot [Tue, 30 Aug 2016 01:31:47 +0000 (01:31 +0000)]
Merge "Include PRESEND updates in ChronologyProtector positions"

7 years agoMerge "resourceloader: Create unit tests for ResourceLoaderContext"
jenkins-bot [Tue, 30 Aug 2016 00:27:41 +0000 (00:27 +0000)]
Merge "resourceloader: Create unit tests for ResourceLoaderContext"

7 years agoMerge "Fixing dry-run logic in updateCollation.php"
jenkins-bot [Tue, 30 Aug 2016 00:13:47 +0000 (00:13 +0000)]
Merge "Fixing dry-run logic in updateCollation.php"

7 years agoMerge "Move some DB error classes with the rest as type DBUnexpectedError"
jenkins-bot [Tue, 30 Aug 2016 00:11:43 +0000 (00:11 +0000)]
Merge "Move some DB error classes with the rest as type DBUnexpectedError"

7 years agoMerge "LinksUpdate: Add functions returning changed page properties"
jenkins-bot [Tue, 30 Aug 2016 00:04:27 +0000 (00:04 +0000)]
Merge "LinksUpdate: Add functions returning changed page properties"

7 years agoresourceloader: Create unit tests for ResourceLoaderContext
Timo Tijhof [Mon, 29 Aug 2016 23:35:55 +0000 (16:35 -0700)]
resourceloader: Create unit tests for ResourceLoaderContext

* Fix up one last use of global config vars in this class.
  Other places in this class already used $rl->getConfig().
  This way we don't inherit all of MediaWikiTestCase.

* Add unit tests covering all of ResourceLoaderContext
  except expandModuleNames and getImageObj (tested in better
  places already with the right @covers).

* Increase coverage for expandModuleNames(), add missing case
  of when modules are not in alphabetical order.

Change-Id: Id19b084d37a6c3a77b36e03509adffb6b156fee1

7 years agoLinksUpdate: Add functions returning changed page properties
cenarium [Thu, 28 Jan 2016 18:58:44 +0000 (19:58 +0100)]
LinksUpdate: Add functions returning changed page properties

This adds getAddedProperties and getRemovedProperties functions
to LinksUpdate. They are available only after the update, so for
extensions in the LinksUpdateComplete hook. This is useful for
example if an extension caches a page property; if the property
gets changed it may want to purge the cache.

This is similar to the getAddedLinks and getRemovedLinks
functions.

Change-Id: I0c73b3d181f32502da75687857ae9aeff731f559

7 years agoFixing dry-run logic in updateCollation.php
Kaldari [Mon, 29 Aug 2016 23:29:24 +0000 (16:29 -0700)]
Fixing dry-run logic in updateCollation.php

Currently if you run updateCollation.php in dry-run mode, it ignores
the other parameters and doesn't give you a row estimate. Now it
will behave the same as an actual run (just without making any
changes to the database).

Change-Id: I25a9751d8ab7554e7975e5f08122dd1ddaaf40a7

7 years agoMerge "Make WikiPage::doDeleteArticle more robust"
jenkins-bot [Mon, 29 Aug 2016 23:28:12 +0000 (23:28 +0000)]
Merge "Make WikiPage::doDeleteArticle more robust"

7 years agoMove some DB error classes with the rest as type DBUnexpectedError
Aaron Schulz [Mon, 29 Aug 2016 22:48:01 +0000 (15:48 -0700)]
Move some DB error classes with the rest as type DBUnexpectedError

Change-Id: I97d61d32495e6d88ce274772369390c76d7ff3c4

7 years agoMake WikiPage::doDeleteArticle more robust
daniel [Sat, 25 Jun 2016 16:25:13 +0000 (18:25 +0200)]
Make WikiPage::doDeleteArticle more robust

When it becomes impossible to load the content of a page due to some
error or misconfiguration, we still want to be able to delete that
page. This change makes WikiPage::doDeleteArticle more robust by catching
any exceptions that may be thrown while trying to load the page content
during the deletion process.

See T128466 for context.

Change-Id: I19f2d16850a3c1af5b504a70a27b9bf1330bc68d

7 years agoMerge "Floor slave lag before display"
jenkins-bot [Mon, 29 Aug 2016 23:16:54 +0000 (23:16 +0000)]
Merge "Floor slave lag before display"

7 years agoMerge "resourceloader: Add test coverage for DerivativeResourceLoaderContext"
jenkins-bot [Mon, 29 Aug 2016 23:00:46 +0000 (23:00 +0000)]
Merge "resourceloader: Add test coverage for DerivativeResourceLoaderContext"

7 years agoMerge "Use DB_SLAVE in TemporaryPasswordPrimaryAuthenticationProvider"
jenkins-bot [Mon, 29 Aug 2016 22:52:09 +0000 (22:52 +0000)]
Merge "Use DB_SLAVE in TemporaryPasswordPrimaryAuthenticationProvider"

7 years agodatabase: Clean up profiling code in DatabaseBase
Aaron Schulz [Mon, 29 Aug 2016 17:41:59 +0000 (10:41 -0700)]
database: Clean up profiling code in DatabaseBase

This cuts down on conditionals and ScopedCallback use.

Change-Id: Ie478c613b062e45120cdd626f9fb9de09594c638

7 years agoresourceloader: Add test coverage for DerivativeResourceLoaderContext
Timo Tijhof [Mon, 29 Aug 2016 21:34:57 +0000 (14:34 -0700)]
resourceloader: Add test coverage for DerivativeResourceLoaderContext

* Re-order method tests to match source class.
* Add @covers.
* Add tests to make coverage 100%.

Change-Id: I46bdb66bc08120a82d44208a39d2dd6b7de18de1

7 years agoMove HTTP 304 check from performRequest to ViewAction
Aaron Schulz [Thu, 25 Aug 2016 00:19:58 +0000 (17:19 -0700)]
Move HTTP 304 check from performRequest to ViewAction

* Follow-up to 8b141886edebc
* The method is now called after the setCdnMaxage() call
  in performAction.
* Allow any CDN urls for the title now, check $wgDebugToolbar,
  and allows caching redirects. The multi-step redirect case does
  not cache however, for simplicity.
* Removed now-unused code in Article that calculated $timestamp.

Change-Id: Ic4f4e3a79d7d386c2f15ca5b11dddf5c57ff9e9f

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 29 Aug 2016 19:58:25 +0000 (21:58 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I1c626bebfe8884c968a8e76e151496f224f90cea

7 years agoMerge "mediawiki.api.messages: Fix typo in comments"
jenkins-bot [Mon, 29 Aug 2016 18:57:31 +0000 (18:57 +0000)]
Merge "mediawiki.api.messages: Fix typo in comments"

7 years agomediawiki.api.messages: Fix typo in comments
Bartosz Dziewoński [Mon, 29 Aug 2016 17:06:02 +0000 (19:06 +0200)]
mediawiki.api.messages: Fix typo in comments

Change-Id: I2d51a982408f54ea62e38d7b3da99af4b73541c6

7 years agoRename EditButtonPublishNotSave to EditSubmitButtonLabelPublish
James D. Forrester [Mon, 29 Aug 2016 17:44:44 +0000 (10:44 -0700)]
Rename EditButtonPublishNotSave to EditSubmitButtonLabelPublish

Per legoktm.

Change-Id: I4fbe54876095378a476399bf5e336c8df3e91e14

7 years agoMerge "Directly use getSession for specialPreferencesSaveSuccess"
jenkins-bot [Mon, 29 Aug 2016 16:54:15 +0000 (16:54 +0000)]
Merge "Directly use getSession for specialPreferencesSaveSuccess"

7 years agoMerge "Fix shutdown() code duplication in LBFactory"
jenkins-bot [Mon, 29 Aug 2016 16:47:04 +0000 (16:47 +0000)]
Merge "Fix shutdown() code duplication in LBFactory"

7 years agoMerge "Remove Block::purgeExpired() call from block query API"
jenkins-bot [Mon, 29 Aug 2016 16:30:15 +0000 (16:30 +0000)]
Merge "Remove Block::purgeExpired() call from block query API"