lhc/web/wiklou.git
7 years agoHTMLMultiSelectField: Add 'dropdown' option for 'mw-chosen' behavior and document
Bartosz Dziewoński [Mon, 8 Aug 2016 19:40:12 +0000 (21:40 +0200)]
HTMLMultiSelectField: Add 'dropdown' option for 'mw-chosen' behavior and document

Previously, you could pass 'cssclass' => 'mw-chosen' in the form
descriptor for a 'multiselect' field, and it'd be automatically
converted to a text field with a dropdown allowing values to be
selected. This is not very intuitive (unless you know what the Chosen
library is) and was not documented anywhere except for release notes.

The new recommended and documented way to achieve this is by passing
'dropdown' => true. Old way is supported for backwards compatibility.

Also, add the 'jquery.chosen' module to the page server-side.

Change-Id: I3a025e1c3c7571e930a35e020d73d558fdc433d0

7 years agoHTMLForm: Refactor loading of modules required to infuse fields
Bartosz Dziewoński [Sun, 31 Jul 2016 14:56:23 +0000 (16:56 +0200)]
HTMLForm: Refactor loading of modules required to infuse fields

Rather than have a master list in autoinfuse.js (duplicated in
hide-if.js), we put this information in each field class and put it
in the generated HTML as a separate 'data-' attribute. This also
allows new fields defined by extensions to be correctly autoinfused.

Change-Id: I3da75706209cbc16b19cc3f02b355e58ca75fec9

7 years agoSpecialExport: Add 'hide-if' to form definition
Bartosz Dziewoński [Sun, 31 Jul 2016 14:35:59 +0000 (16:35 +0200)]
SpecialExport: Add 'hide-if' to form definition

Change-Id: Ic03620849f863bc4e21347984f84c532c189c4ea

7 years agoSupport 'hide-if' parameters in OOUI HTMLForm
Bartosz Dziewoński [Sat, 30 Jul 2016 23:19:26 +0000 (01:19 +0200)]
Support 'hide-if' parameters in OOUI HTMLForm

For plain HTML forms, we just put the required data in the 'data-hide-if'
attribute. For OOUI, it's not so easy - while we could just call
->setAttribute(...) on the FieldLayout, this would disappear when
infusing (since it's not part of the config), and we have no control over
when some piece of JavaScript decides to infuse the element. Even if we
managed to handle it first, infusing replaces the DOM nodes for elements
with new ones, which would "disable" our event handlers.

To solve this, I'm creating two new layouts HTMLFormFieldLayout and
HTMLFormActionFieldLayout (subclassing FieldLayout and ActionFieldLayout)
with a common trait (mixin) HTMLFormElement. This is all implemented both
in PHP and JS. Right now it only serves to carry the 'hide-if' data from
PHP to JS code, but I imagine it'll be extended in the future for other
HTMLForm features not yet present in the OOUI version (e.g. 'cloner'
fields).

The code in hide-if.js has been modified to work with jQuery objects or
with OOjs UI Widgets with minimal changes. I had to duplicate the map of
HTMLFormField classes to modules they require there (from autoinfuse.js),
which is ugly - I'm fixing this in a follow-up commit
I3da75706209cbc16b19cc3f02b355e58ca75fec9.

Bug: T141558
Change-Id: I3b06a6f75eed01d3e0bdc5dd33e1b40b7a2fc0a2

7 years agoMWTimestamp: Allow providing a DateTime object directly
Kunal Mehta [Mon, 22 Aug 2016 02:17:01 +0000 (19:17 -0700)]
MWTimestamp: Allow providing a DateTime object directly

For cases where you already have a DateTime object on hand and want to
use MWTimestamp's formatting code. Since MWTimestamp stores DateTime
objects internally, just set it to the $timestamp member variable.

Change-Id: Ie60392e32743d4d082d2c9347ef68418d5eb86ad

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 21 Aug 2016 20:08:21 +0000 (22:08 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I28649c5ec88c05c17aeb113f10b0b27a13cc9240

7 years agodebug: Don't separately calculate query runtime
Kunal Mehta [Sun, 21 Aug 2016 01:40:26 +0000 (18:40 -0700)]
debug: Don't separately calculate query runtime

It is already calculated for the transaction profiler, so re-use that.

Change-Id: Ifcc43484c25e00e2409fbfb421ca2f9cecd67492

7 years agodebug: Remove unused 'jquery.tipsy' dependency
Kunal Mehta [Sun, 21 Aug 2016 01:30:41 +0000 (18:30 -0700)]
debug: Remove unused 'jquery.tipsy' dependency

mediawiki.debug has not used jquery.tipsy since
9144673b5c95.

Change-Id: I3ad61c786437c513eb4cfcb145522225e9942a72

7 years agoMerge "Give all idle transaction callbacks a chance to run"
jenkins-bot [Sun, 21 Aug 2016 05:13:50 +0000 (05:13 +0000)]
Merge "Give all idle transaction callbacks a chance to run"

7 years agoGive all idle transaction callbacks a chance to run
Aaron Schulz [Fri, 19 Aug 2016 22:25:08 +0000 (15:25 -0700)]
Give all idle transaction callbacks a chance to run

Catch exceptions from other DB handle callback runs.
Also use the first exception instead of the last for
callback runs, as the it is more likely to be meaningfull.

Change-Id: Ib180d684b090ae26ad6ec0854322d5cb4286cc81

7 years agoFix repo url in docs/database.txt
Paladox [Sun, 21 Aug 2016 00:00:51 +0000 (01:00 +0100)]
Fix repo url in docs/database.txt

Change-Id: I9c7558252cc71126e45acb56c8c4fc68d353c86e

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

Change-Id: Icd414580d3aeb2aba4af16f299ec339a2d843c8e

7 years agoMerge "Do not automatically infuse any OOjs UI widgets"
jenkins-bot [Sat, 20 Aug 2016 16:54:50 +0000 (16:54 +0000)]
Merge "Do not automatically infuse any OOjs UI widgets"

7 years agoMerge "Split the 'mediawiki.htmlform' module code into multiple files"
jenkins-bot [Sat, 20 Aug 2016 16:54:46 +0000 (16:54 +0000)]
Merge "Split the 'mediawiki.htmlform' module code into multiple files"

7 years agoMerge "Detect when callers catch DB errors and fail to rollback"
jenkins-bot [Fri, 19 Aug 2016 22:23:56 +0000 (22:23 +0000)]
Merge "Detect when callers catch DB errors and fail to rollback"

7 years agoDetect when callers catch DB errors and fail to rollback
Aaron Schulz [Fri, 19 Aug 2016 20:12:27 +0000 (13:12 -0700)]
Detect when callers catch DB errors and fail to rollback

This makes it harder to accidently circumvent the MWExceptionHandler
rollback logic.

Change-Id: Ia1f89fa0f88ff3aacf5d9b93300dbf909fa74fdd

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 19 Aug 2016 20:00:33 +0000 (22:00 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Idd0a7553ba64610ce873c52909baa1bff5ee0b14

7 years agoMerge "Allow requiring cache size for page props"
jenkins-bot [Fri, 19 Aug 2016 19:39:17 +0000 (19:39 +0000)]
Merge "Allow requiring cache size for page props"

7 years agoMerge "Extract ParserOutput search index data fields from WikiTextContentHandler"
jenkins-bot [Fri, 19 Aug 2016 18:40:17 +0000 (18:40 +0000)]
Merge "Extract ParserOutput search index data fields from WikiTextContentHandler"

7 years agoExtract ParserOutput search index data fields from WikiTextContentHandler
aude [Tue, 9 Aug 2016 17:22:09 +0000 (13:22 -0400)]
Extract ParserOutput search index data fields from WikiTextContentHandler

Bug: T142491
Change-Id: I69b010b893135e53fac7f16f4b927b8fbcba06d2

7 years agoMerge "Send registration welcome email post-commit"
jenkins-bot [Fri, 19 Aug 2016 08:29:18 +0000 (08:29 +0000)]
Merge "Send registration welcome email post-commit"

7 years agoSend registration welcome email post-commit
Gergő Tisza [Fri, 19 Aug 2016 06:06:25 +0000 (06:06 +0000)]
Send registration welcome email post-commit

Follow-up to I8f1bd3e.

Change-Id: I26e7a1857363d4e6627a0f583a8556d0fd8ae623

7 years agoMerge "OutputPage: Make ResourceLoader position exemption more generic"
jenkins-bot [Fri, 19 Aug 2016 04:37:04 +0000 (04:37 +0000)]
Merge "OutputPage: Make ResourceLoader position exemption more generic"

7 years agoClarify some WANObjectCache docs
Aaron Schulz [Fri, 19 Aug 2016 03:53:20 +0000 (20:53 -0700)]
Clarify some WANObjectCache docs

Change-Id: I819a630ebba4122a757f04fbf702122069af4fb1

7 years agoMerge "objectcache: add mcrouter support to WANObjectCache"
jenkins-bot [Fri, 19 Aug 2016 02:57:18 +0000 (02:57 +0000)]
Merge "objectcache: add mcrouter support to WANObjectCache"

7 years agoOutputPage: Make ResourceLoader position exemption more generic
Timo Tijhof [Fri, 19 Aug 2016 02:04:21 +0000 (19:04 -0700)]
OutputPage: Make ResourceLoader position exemption more generic

Follows-up 80e5b160e which moved queue formatting out of OutputPage into a
a separate ResourceLoaderClientHtml class.

The special handling for 'user' and 'user.styles' modules, and the exempt
module groups was kept in OutputPage. However the handling for it was
hardcoded for the modules in that group by default. It did not account for
modules with a group of 'user' loaded by an extension (e.g. GlobalCssJs).
GlobalCssJs modules were wrongly loaded in the regular style queue
(still in a separate request group, but not in the right cascading order
below the DynamicSyles marker).

This commit generalises the handling previously put in buildExemptModules
and moves it to getRlClient() so that it may apply to all style modules.

This commit should be a no-op besides the moving of any <link rel=stylesheet>
for non-core modules in group 'site' or 'user' now being one line lower
in the <head> HTML (after the DynamicStyles marker).

Bug: T143357
Change-Id: I1d6ea10b42293acfc535578172ad7ab2369f6299

7 years agoMerge "Check for warnings for assembled file after a chunked upload"
jenkins-bot [Fri, 19 Aug 2016 02:01:26 +0000 (02:01 +0000)]
Merge "Check for warnings for assembled file after a chunked upload"

7 years agoMerge "API: Insist authn parameters be in the POST body"
jenkins-bot [Fri, 19 Aug 2016 01:43:11 +0000 (01:43 +0000)]
Merge "API: Insist authn parameters be in the POST body"

7 years agoCheck for warnings for assembled file after a chunked upload
Bartosz Dziewoński [Wed, 17 Aug 2016 15:57:47 +0000 (17:57 +0200)]
Check for warnings for assembled file after a chunked upload

Bug: T130564
Change-Id: Iebc84f030c45c634dc29b02cbd720f33abf50f2b

7 years agoDo not automatically infuse any OOjs UI widgets
Bartosz Dziewoński [Tue, 26 Jul 2016 12:12:21 +0000 (14:12 +0200)]
Do not automatically infuse any OOjs UI widgets

This is not really what we had in mind when developing the infusion
feature and I think it's not helpful. Most of the time there is just
no benefit; a ButtonWidget generated in PHP and in JS behaves and
looks pretty much the same, and rebuilding it through infusion is a
small performance hit. If you're not adding any event handlers, it only
makes sense for various dropdowns, which have themed styling.

For the primary use case of adding JS behaviors to PHP widgets you
need to call OO.ui.infuse() anyway to get a reference to the JS
widget, and not infusing automatically should make it easier to reason
about your code. Infusion tries to be very transparent, but it can't
hide the fact that the DOM is re-built, making your references to DOM
nodes from before infusion useless and losing anything from PHP that
wasn't included in the config (e.g. custom attributes).

This commit removes automated infusion from mediawiki.page.ready
and adds some custom code in mediawiki.special.movePage and
mediawiki.htmlform. I see only two extensions using infusable OOjs UI
widgets in Gerrit (ArticlePlaceholder and ExtensionDistributor) and
neither should be affected by this change.

Change-Id: I56608c537fc57c5c54960b0603694f2612f45618

7 years agoSplit the 'mediawiki.htmlform' module code into multiple files
Bartosz Dziewoński [Sat, 30 Jul 2016 23:15:07 +0000 (01:15 +0200)]
Split the 'mediawiki.htmlform' module code into multiple files

This module implements several related, but separate enhancements to
HTMLForm. While it makes sense to use a single ResourceLoader module
to serve this code, it doesn't make sense to keep all of it in a
single file. It was approaching 500 lines of code, and pieces of the
separate features were mixed together.

This commit mostly shuffles code around, only tweaking some
indentation, 'var' statements and function wrappers.

There is one small functional change: the enhancements now use the
'htmlform.enhance' mw.hook, which is fired on document-ready and when
new fields are added dynamically. Previously it was only used to allow
extensions to define their own HTMLForm enhancements.

(Also moved HTMLForm styles into the same directory as the newly-split
scripts.)

Change-Id: I22054b39868239ddb59317dadfaaa067653f8804

7 years agoUploadBase: Stop mLocalFile doubling as stashed file
Bartosz Dziewoński [Wed, 17 Aug 2016 18:43:55 +0000 (20:43 +0200)]
UploadBase: Stop mLocalFile doubling as stashed file

"I've a great idea", they said. "You know what would be cool? If I
made this boring getter, getLocalFile(), return something completely
different after the file was stashed. This will be a nice surprise for
someone in the future to discover", they added gleefully.

I am pretty sure everything still works, but I never could get async
upload publishing to work locally, so I'd appreciate some testing.

Change-Id: I11dcf2ed89e4f1dd8ddf081af521da005efdbf39

7 years agoResourceLoaderImage: Use hashes for versioning instead of timestamps
Timo Tijhof [Wed, 17 Aug 2016 18:57:57 +0000 (11:57 -0700)]
ResourceLoaderImage: Use hashes for versioning instead of timestamps

Remove use of the deprecated getModifiedTime() method and incorporate
file information in getDefinitionSummary() directly, instead of relying
on the parent class to include getModifiedTime().

Change getDefinitionSummary() to append to the summary instead of
setting arbitrary keys in the array directly to avoid conflicts.
This matches the pattern used elsewhere.

Change ResourceLoaderImage to use file hashes instead of timestamps
to avoid needless cache invalidation. At Wikimedia these modules
tend to roll over every week due to git not storing timestamps.
See also T104950, 9112c9347bf37cee996.

Change-Id: I5d019bfb991c3b8042d1db14a853ba46cc690315

7 years agoMerge "Issue 301 redirects for Special:Search/searchterm"
jenkins-bot [Thu, 18 Aug 2016 22:48:13 +0000 (22:48 +0000)]
Merge "Issue 301 redirects for Special:Search/searchterm"

7 years agoobjectcache: add mcrouter support to WANObjectCache
Aaron Schulz [Fri, 12 Aug 2016 02:27:50 +0000 (19:27 -0700)]
objectcache: add mcrouter support to WANObjectCache

* Update documentation about relay methods.
* Change interim key set() to add() to avoid broadcasting it.
* Remove the behavior of doing purges synchronously in the
  local DC first before relay. In both the event relayer and
  mcrouter case, they will be asynchronous. It was hardly
  even possible to use such behavior since loads come from
  slave DBs, which do not see changes right after COMMIT.

Bug: T97562
Change-Id: I7759c82ae6e1b72fc227882a99c9a712a46374f6

7 years agoIssue 301 redirects for Special:Search/searchterm
Erik Bernhardson [Wed, 17 Aug 2016 18:35:54 +0000 (11:35 -0700)]
Issue 301 redirects for Special:Search/searchterm

Including the search term, which is PII, in the page title allows for
leaking this information through page view dumps. Instead of happily
handling these issue a 301 redirect to tell clients they should not
be issueing these requests, and should instead use the search query
parameter. Dumps at wikimedia remove 30[123] response codes from the
dump output so this will also stop leaking the PII.

Change-Id: Icce7cc4585e90742a8dd3513e7c9f7276e479cd7

7 years agoMerge "Send new account and password reset emails post-commit"
jenkins-bot [Thu, 18 Aug 2016 22:29:51 +0000 (22:29 +0000)]
Merge "Send new account and password reset emails post-commit"

7 years agoAPI: Insist authn parameters be in the POST body
Brad Jorsch [Thu, 18 Aug 2016 17:36:11 +0000 (13:36 -0400)]
API: Insist authn parameters be in the POST body

Passwords should always be submitted in the POST body, not in the query
string. Thus, a warning will now be returned if the password for
action=login or any sensitive authentication request parameters for
AuthManager actions are found in the query string.

These warnings should be upgraded to errors in 1.29.

Change-Id: Ifb2c684bb28c9acc004be2b0c2fef839eb7624aa

7 years agoMerge "AuthManager: Allow for flagging fields as "sensitive""
jenkins-bot [Thu, 18 Aug 2016 20:59:08 +0000 (20:59 +0000)]
Merge "AuthManager: Allow for flagging fields as "sensitive""

7 years agoMerge "Type hint array for HTMLFormFieldCloner::getInputHTMLForKey()"
jenkins-bot [Thu, 18 Aug 2016 20:40:46 +0000 (20:40 +0000)]
Merge "Type hint array for HTMLFormFieldCloner::getInputHTMLForKey()"

7 years agoSend new account and password reset emails post-commit
Aaron Schulz [Thu, 18 Aug 2016 20:23:33 +0000 (13:23 -0700)]
Send new account and password reset emails post-commit

Change-Id: I8f1bd3e882e20fefa5ce0167202d511aa066cfe2

7 years agoMerge "Localisation updates from https://translatewiki.net."
L10n-bot [Thu, 18 Aug 2016 20:16:48 +0000 (20:16 +0000)]
Merge "Localisation updates from https://translatewiki.net."

7 years agoMerge "Revert "AuthManager: Commit transaction after auto-creating a user""
jenkins-bot [Thu, 18 Aug 2016 20:16:47 +0000 (20:16 +0000)]
Merge "Revert "AuthManager: Commit transaction after auto-creating a user""

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 18 Aug 2016 20:07:39 +0000 (22:07 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I421964a5b97efd9f366b2f95e09422231c2db299

7 years agoAllow requiring cache size for page props
Stanislav Malyshev [Thu, 18 Aug 2016 06:25:37 +0000 (23:25 -0700)]
Allow requiring cache size for page props

Needed for batch processing where size of the batch is known
and the batch should fit in cache.

Change-Id: Ib6d6e6ab7e12788c934cd0e973bc35e133aeccbb

7 years agoAuthManager: Allow for flagging fields as "sensitive"
Brad Jorsch [Thu, 18 Aug 2016 17:03:10 +0000 (13:03 -0400)]
AuthManager: Allow for flagging fields as "sensitive"

This can allow AuthenticationRequests to flag certain fields as
sensitive, so e.g. the API can insist they be in the POST body rather
than in the query string.

Change-Id: I7b12aa4cd8f5a570f0df7213c0f9084b5a4d4de7

7 years agoRevert "AuthManager: Commit transaction after auto-creating a user"
Aaron Schulz [Sat, 23 Jul 2016 00:00:13 +0000 (17:00 -0700)]
Revert "AuthManager: Commit transaction after auto-creating a user"

81be9512a022 should obviate the main desire for this.
  The normal commit step is now relied upon again.
820f5d6ce57f and a26fbb67054 enforce DBO_TRX transactions.
* Committing the implicit transaction(s) prematurely is bad
  for web request and cross-DB transactionality. Only code
  that has clear outermost DB context (e.g. jobs/maintenance)
  should be doing things like this as it becomes hard to reason
  about (e.g. how much the request/caller needs atomicity
  or whether there is an outer (start|end)Atomic section).

This reverts commit 83c66caa0831086db7c2033ddda38106584060d0.

Change-Id: I1a5533b239e53f2089f239651c6fdf97e51c9062

7 years agoRevert "Work around T87871 to avoid double-loading OOjs UI PHP styles"
Bartosz Dziewoński [Wed, 17 Aug 2016 17:35:03 +0000 (17:35 +0000)]
Revert "Work around T87871 to avoid double-loading OOjs UI PHP styles"

We no longer need this workaround after T87871 was fixed.

This reverts commit e65186c443a5887024da50b66fe92bcf267a0752.

Change-Id: Ieba46fb07e1e92d9a6a86cb84d0ecaf208312baa

7 years agoResourceLoaderImageModule: Mark as style-only
Bartosz Dziewoński [Thu, 18 Aug 2016 19:00:51 +0000 (21:00 +0200)]
ResourceLoaderImageModule: Mark as style-only

Follow-up to a464d1d41d69f12fe93146629254f6c785f43d81.

Bug: T87871
Change-Id: Iff307af1cf550c02bea94d596f316b30da259900

7 years agoMerge "Add sanity check to getScopedLockAndFlush() for pending writes"
jenkins-bot [Thu, 18 Aug 2016 18:31:54 +0000 (18:31 +0000)]
Merge "Add sanity check to getScopedLockAndFlush() for pending writes"

7 years agoAllow marking legacy ContentHandler hooks as deprecated
Kunal Mehta [Wed, 17 Aug 2016 05:53:16 +0000 (22:53 -0700)]
Allow marking legacy ContentHandler hooks as deprecated

Instead of having a single development flag that controls whether all
the hooks emit warnings, use the standard hook deprecation method to
mark individual hooks as deprecated once we have determined that their
usage is minimal.

Change-Id: I9a00ae131cb7f609c1d44926d1f6547089f70c34

7 years agoMerge "resourceloader: Move mw.loader qunit tests to a separate file"
jenkins-bot [Thu, 18 Aug 2016 17:42:53 +0000 (17:42 +0000)]
Merge "resourceloader: Move mw.loader qunit tests to a separate file"

7 years agoMerge "Remove useless check for MEDIAWIKI definition"
jenkins-bot [Thu, 18 Aug 2016 17:27:55 +0000 (17:27 +0000)]
Merge "Remove useless check for MEDIAWIKI definition"

7 years agoRemove useless check for MEDIAWIKI definition
Chad Horohoe [Thu, 18 Aug 2016 17:11:01 +0000 (10:11 -0700)]
Remove useless check for MEDIAWIKI definition

This class isn't any more special than others, it can be autoloaded
like all the others and there's nothing to execute in the file scope

Change-Id: I7c415025c9c15cf19110f39452df3a14e44bf6f9

7 years agoMerge "API: Force indexes for prop=linkshere|transcludedin|fileusage"
jenkins-bot [Thu, 18 Aug 2016 10:39:09 +0000 (10:39 +0000)]
Merge "API: Force indexes for prop=linkshere|transcludedin|fileusage"

7 years agoAdd sanity check to getScopedLockAndFlush() for pending writes
Aaron Schulz [Thu, 18 Aug 2016 06:50:21 +0000 (23:50 -0700)]
Add sanity check to getScopedLockAndFlush() for pending writes

Also made a few related exception message more uniform.

Change-Id: I4491f16493b3d9f8ab8fad45fc6373e0d7f7d67b

7 years agogetScopedLockAndFlush() should not commit when exceptions are thrown
Aaron Schulz [Wed, 17 Aug 2016 21:05:41 +0000 (14:05 -0700)]
getScopedLockAndFlush() should not commit when exceptions are thrown

Previously it would commit() since the __destruct() call happens
as an exception is thrown but before it reached MWExceptionHandler.

Change-Id: I3d4186eb9ec02cf4d42ac84590869e2cf29b30b4

7 years agoMerge "installer: Update assets README to mention public-domain.png."
jenkins-bot [Wed, 17 Aug 2016 23:14:13 +0000 (23:14 +0000)]
Merge "installer: Update assets README to mention public-domain.png."

7 years agoMerge "Make doAtomicSection() return the callback result"
jenkins-bot [Wed, 17 Aug 2016 23:01:12 +0000 (23:01 +0000)]
Merge "Make doAtomicSection() return the callback result"

7 years agoinstaller: Update assets README to mention public-domain.png.
Timo Tijhof [Wed, 17 Aug 2016 22:56:17 +0000 (15:56 -0700)]
installer: Update assets README to mention public-domain.png.

Follows-up be0b28d4. This way it'll be found when searching for the file.

Change-Id: I57fafa0b3e6a63a61f7c67e3279ee875eae2a344

7 years agoMerge "ObjectFactoryTest: Add tests for 'factory' option"
jenkins-bot [Wed, 17 Aug 2016 22:55:34 +0000 (22:55 +0000)]
Merge "ObjectFactoryTest: Add tests for 'factory' option"

7 years agoMerge "phpunit: Add @covers to ObjectFactoryTest"
jenkins-bot [Wed, 17 Aug 2016 22:50:58 +0000 (22:50 +0000)]
Merge "phpunit: Add @covers to ObjectFactoryTest"

7 years agoMake doAtomicSection() return the callback result
Aaron Schulz [Wed, 17 Aug 2016 22:43:48 +0000 (15:43 -0700)]
Make doAtomicSection() return the callback result

This makes the method a bit more convenient

Change-Id: Ic140e200cddcdf8e1a09b65c94d2da3aed62756d

7 years agoresourceloader: Move mw.loader qunit tests to a separate file
Timo Tijhof [Wed, 17 Aug 2016 21:49:09 +0000 (14:49 -0700)]
resourceloader: Move mw.loader qunit tests to a separate file

Change-Id: I867f00b0845664a2b670c460c58bf4f7791e0b38

7 years agoMerge "Fix text extraction where we don't have proper file handler"
jenkins-bot [Wed, 17 Aug 2016 21:30:04 +0000 (21:30 +0000)]
Merge "Fix text extraction where we don't have proper file handler"

7 years agoMerge "Remove pointless override of doStashFile in UploadFromStash"
jenkins-bot [Wed, 17 Aug 2016 21:14:20 +0000 (21:14 +0000)]
Merge "Remove pointless override of doStashFile in UploadFromStash"

7 years agoMerge "resourceloader: Add structure unit test to confirm messages exist"
jenkins-bot [Wed, 17 Aug 2016 21:10:16 +0000 (21:10 +0000)]
Merge "resourceloader: Add structure unit test to confirm messages exist"

7 years agoMerge "Make transaction enforcement stricter"
jenkins-bot [Wed, 17 Aug 2016 21:06:33 +0000 (21:06 +0000)]
Merge "Make transaction enforcement stricter"

7 years agoRemove pointless override of doStashFile in UploadFromStash
Aaron Schulz [Wed, 17 Aug 2016 19:22:19 +0000 (12:22 -0700)]
Remove pointless override of doStashFile in UploadFromStash

Change-Id: If6bc31d7398c68320a6633b045c33279bf6f8dbd

7 years agoFix text extraction where we don't have proper file handler
Stanislav Malyshev [Wed, 17 Aug 2016 20:54:23 +0000 (13:54 -0700)]
Fix text extraction where we don't have proper file handler

Bug: T143251
Change-Id: I611f6a001bbcea971cc9126bd3f004622e88b47d

7 years agoresourceloader: Add structure unit test to confirm messages exist
Timo Tijhof [Tue, 15 Mar 2016 03:11:55 +0000 (03:11 +0000)]
resourceloader: Add structure unit test to confirm messages exist

Bug: T129976
Change-Id: I5333523efe3e7b9191e871d67d9eb650002c7784

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

Change-Id: I2ab6b5289ad6ef9afec11b3306a76e09ab9b5371

7 years agoMerge "Run 'UploadStashFile' hook for chunked uploads too"
jenkins-bot [Wed, 17 Aug 2016 19:38:10 +0000 (19:38 +0000)]
Merge "Run 'UploadStashFile' hook for chunked uploads too"

7 years agoMerge "objectcache: Optimize changeTTL() for SqlBagOStuff"
jenkins-bot [Wed, 17 Aug 2016 19:28:24 +0000 (19:28 +0000)]
Merge "objectcache: Optimize changeTTL() for SqlBagOStuff"

7 years agoobjectcache: Optimize changeTTL() for SqlBagOStuff
Aaron Schulz [Mon, 15 Aug 2016 19:21:10 +0000 (12:21 -0700)]
objectcache: Optimize changeTTL() for SqlBagOStuff

Change-Id: I539dd83175a8ea922221f194e23ca47aea7539cf

7 years agoMerge "Log failure reasons in ApiLogin"
jenkins-bot [Wed, 17 Aug 2016 18:10:04 +0000 (18:10 +0000)]
Merge "Log failure reasons in ApiLogin"

7 years agoMerge "ApiBase::getModuleSourceInfo(): Use $wgExtensionDirectory"
jenkins-bot [Wed, 17 Aug 2016 17:35:16 +0000 (17:35 +0000)]
Merge "ApiBase::getModuleSourceInfo(): Use $wgExtensionDirectory"

7 years agoMerge "AuthManager: do not rewrite PRIMARY_REQUIRED to REQUIRED"
jenkins-bot [Wed, 17 Aug 2016 17:14:30 +0000 (17:14 +0000)]
Merge "AuthManager: do not rewrite PRIMARY_REQUIRED to REQUIRED"

7 years agoObjectFactoryTest: Add tests for 'factory' option
Timo Tijhof [Wed, 17 Aug 2016 16:26:38 +0000 (09:26 -0700)]
ObjectFactoryTest: Add tests for 'factory' option

Increase coverage of getObjectFromSpec():

* Case for 'factory' option.
* Case for 'class' option with no arguments.
* Case for missing 'factory' and 'class' options.

Change-Id: Idc9ee73de4f6e55372b4ab5b1afbaa4c7e54509a

7 years agophpunit: Add @covers to ObjectFactoryTest
Timo Tijhof [Wed, 17 Aug 2016 16:11:51 +0000 (09:11 -0700)]
phpunit: Add @covers to ObjectFactoryTest

* expandClosures() wasn't covered at all.
  Make the test dedicated to this feature cover that method.

* constructClassInstance() coverage was almost complete except for
  the exception case. This was covered in a separate test, but it
  was missing its @covers tag.

Change-Id: I73252849a92440fd7ae2c44f9ca58f7bf9c1f92c

7 years agoRun 'UploadStashFile' hook for chunked uploads too
Bartosz Dziewoński [Wed, 17 Aug 2016 13:31:22 +0000 (15:31 +0200)]
Run 'UploadStashFile' hook for chunked uploads too

In UploadFromChunks, doStashFile() only stashes the current chunk,
and stashing the whole file after all chunks are uploaded is done
in concatenateChunks().

Also more custom code on top of custom code to handle ApiMessage
errors, because action=upload is special.

Follow-up to 2ee27d9a4de163dc3a2b752823a04f5338005627.

Change-Id: I968280353f15bbca9b1059631fa2cfd7c3cd2f1d

7 years agoMerge "EditPage: Fix display of errors with multiple messages"
jenkins-bot [Wed, 17 Aug 2016 09:45:22 +0000 (09:45 +0000)]
Merge "EditPage: Fix display of errors with multiple messages"

7 years agoEditPage: Fix display of errors with multiple messages
Kunal Mehta [Wed, 17 Aug 2016 05:59:14 +0000 (22:59 -0700)]
EditPage: Fix display of errors with multiple messages

If a status object returns failure with multiple messages (like in
Content::prepareSave()), then previously the first list item would have
a raw asterisk in front of it instead of being a list item because the
<div> tag was on the same line. Adding a newline before the status
object's wikitext will ensure that the first item is interpreted as part
of the list.

Change-Id: If42b3e745f1bd57c6e7964c8e297dab2bf742d4c

7 years agoAuthManager: do not rewrite PRIMARY_REQUIRED to REQUIRED
Gergő Tisza [Thu, 4 Aug 2016 20:47:57 +0000 (20:47 +0000)]
AuthManager: do not rewrite PRIMARY_REQUIRED to REQUIRED

AuthManager::getAuthenticationRequests() changes
AuthenticationRequest::$required from REQUIRED to PRIMARY_REQUIRED
if the request is from a primary; it made an exception when
all primary providers returned a given request. That exception is
not particularly useful (AuthenticationRequest::mergeFieldInfo()
used to rely on it to determine which fields are required, but
since I9d33bd2 that's not really needed), and knowing which request
is from a primary is useful for other means.

This changes required field semantics in a corner case: when a
primary provider returns two required requests, the previous
behavior was to assume that they are both required; the new one
is to treat them as alternatives (as if they were returned by
two different providers). So when all primary providers return
request X, and one of them returns Y in addition, the fields of X
will not be marked required, while previously that would have been
the case.

Instead of overcomplicating the interface for something that is
unlikely to come up in any real use case, add a new requirement
to PrimaryAuthenticationProvider that it should not return
multiple required requests.

Bug: T141471
Change-Id: I1c1f44d4d6b66f77c876e3459fb97f03483db744

7 years agoMerge "MovePage: Fix old, old bug with moving over redirects"
jenkins-bot [Wed, 17 Aug 2016 05:22:06 +0000 (05:22 +0000)]
Merge "MovePage: Fix old, old bug with moving over redirects"

7 years agoMerge "Actually enable the DBPerformance log in the API"
jenkins-bot [Wed, 17 Aug 2016 04:29:27 +0000 (04:29 +0000)]
Merge "Actually enable the DBPerformance log in the API"

7 years agoLet cleanupCaps.php clean up when $wgCapitalLinks is set to true
Kunal Mehta [Sat, 6 Jun 2015 04:42:45 +0000 (21:42 -0700)]
Let cleanupCaps.php clean up when $wgCapitalLinks is set to true

This enables wikis to go from having $wgCapitalLinks = false to
$wgCapitalLinks = true (default).

Also:
* Declare $namespace member variable
* Fix regression introduced in ac53e45035e where non-dry run page move
was always considered a failure.
* Use MWNamespace::isCapitalized() instead of $wgCapitalLinks

Change-Id: I49caf8c1b49df1519d40b50d4aa26ea721db065d

7 years agoApiBase::getModuleSourceInfo(): Use $wgExtensionDirectory
Kunal Mehta [Sun, 13 Dec 2015 03:45:43 +0000 (19:45 -0800)]
ApiBase::getModuleSourceInfo(): Use $wgExtensionDirectory

This function takes the class file path, and iterates up through its
parent directories until it hits either a registered extension, or $IP
(for core) or $IP/extensions (for an unknown extension). This change
adds $wgExtensionDirectory as another iteration stopper, so that
unregistered extensions in $wgExtensionDirectory will not cause
iteration back up to the filesystem root, or to $IP if
$wgExtensionDirectory is a child of $IP other than $IP/extensions.

Change-Id: I06553591b0b6156e945aad5176479eb71517e77d

7 years agoDocument that wfParseUrl() can also return false
Kunal Mehta [Wed, 17 Aug 2016 03:48:02 +0000 (20:48 -0700)]
Document that wfParseUrl() can also return false

Change-Id: I6927ee13c35ecccc45c392b77d426380cc7a5c53

7 years agoMerge "installer: Remove "public domain" option in favor of CC-0"
jenkins-bot [Wed, 17 Aug 2016 03:42:57 +0000 (03:42 +0000)]
Merge "installer: Remove "public domain" option in favor of CC-0"

7 years agoinstaller: Remove "public domain" option in favor of CC-0
Kunal Mehta [Sun, 24 Jan 2016 18:47:53 +0000 (10:47 -0800)]
installer: Remove "public domain" option in favor of CC-0

Some people don't consider "public domain" to be a valid license
statement, so for new wikis it's better to avoid it entirely. CC-0 works
around all of those issues, so we should be encouraging that instead.

Also it's confusing to have two "public domain" options right next to
each other.

The asset needs to stay so existing wikis that picked "public domain"
don't break.

Bug: T122916
Change-Id: I3c380f79a4f27d4793b84602002f3db5c399ac32

7 years agoParserTest: Remove warning about gd extension not being installed
Kunal Mehta [Tue, 26 Jul 2016 09:39:56 +0000 (02:39 -0700)]
ParserTest: Remove warning about gd extension not being installed

The tests actually pass just fine if gd isn't installed.

Change-Id: Ia37255fd642a8f741f1e1a547702495b3a83b584

7 years agoStubObject: Allow using a factory function to construct the object
Kunal Mehta [Tue, 16 Aug 2016 20:44:28 +0000 (13:44 -0700)]
StubObject: Allow using a factory function to construct the object

If $class is a callable, then assume it is a factory function, and pass
that onto ObjectFactory.

Change-Id: I20c3650843c2803e0f9521d67bb037abfc28e1d9

7 years agoMake transaction enforcement stricter
Aaron Schulz [Sun, 14 Aug 2016 04:26:12 +0000 (21:26 -0700)]
Make transaction enforcement stricter

* Nested begin()/commit() will no-op when inside active
  DBO_TRX transactions, even if no writes happened yet.
  This avoids snapshot loss from REPEATABLE-READ or SSI
  SERIALABLE (postgres). An error will be logged.
* Also no-op when begin() happens, no transaction started,
  but DBO_TRX is set. That should not happen as it can make
  multi-DB commits less robust and can clear snapshots early.
  An error will be logged.
* Throw an error when explicit rollback() is used and DBO_TRX
  is set. This will cause peer DBs to rollback too via the
  logic in MWExceptionHander.
* Callers should use LBFactory methods for doing commit/rollback
  instead.

Change-Id: I31b8b1b112cf9110b805a023732bce4dcff0604c

7 years agoMerge "Do not call the 'UploadStashFile' hook for partially uploaded files"
jenkins-bot [Wed, 17 Aug 2016 00:44:14 +0000 (00:44 +0000)]
Merge "Do not call the 'UploadStashFile' hook for partially uploaded files"

7 years agoMerge "Browser tests: update to mw-selenium 1.7.2 and https"
jenkins-bot [Wed, 17 Aug 2016 00:19:58 +0000 (00:19 +0000)]
Merge "Browser tests: update to mw-selenium 1.7.2 and https"

7 years agoMerge "Hide marked empty elements by default (stage 2)"
jenkins-bot [Wed, 17 Aug 2016 00:09:24 +0000 (00:09 +0000)]
Merge "Hide marked empty elements by default (stage 2)"

7 years agoLog failure reasons in ApiLogin
Gergő Tisza [Tue, 16 Aug 2016 05:52:44 +0000 (05:52 +0000)]
Log failure reasons in ApiLogin

Bug: T142600
Change-Id: Id5af923ef10c31fc15e5d4da43ce220e1258b723

7 years agoDo not call the 'UploadStashFile' hook for partially uploaded files
Bartosz Dziewoński [Tue, 16 Aug 2016 23:34:52 +0000 (01:34 +0200)]
Do not call the 'UploadStashFile' hook for partially uploaded files

Consumers of this hook don't expect partial files, and even if they did,
they have no way to tell if they've been given a partial file.

Also document a pre-existing restriction that verifyUpload() must be
called first (for non-partial files). ApiUpload previously called this
function for partial files too, causing T143161.

Follow-up to 2ee27d9a4de163dc3a2b752823a04f5338005627.

Bug: T143161
Change-Id: I107cb957e046545ea72834d72233cc1ed2867e42

7 years agoMerge "SkinTemplate: Move bottomScripts() back sightly"
jenkins-bot [Tue, 16 Aug 2016 23:24:05 +0000 (23:24 +0000)]
Merge "SkinTemplate: Move bottomScripts() back sightly"