Commit graph

115 commits

Author SHA1 Message Date
This, that and the other
f3f2df07ec Add parameter to API modules to apply change tags to log entries
Adds support for tagging log entries for the block, import,
managetags, and move API modules, using a 'tags' parameter.

Bug: T97720
Change-Id: I9d75d2cece317a7704c4bc6d734ad3cafe24544e
2017-01-12 16:30:17 -06:00
Yuriy Shnitkovskiy
68a8243d49 Replace Linker::link() with LinkRenderer in some special pages
* SpecialEditTags
* SpecialEmailuser
* SpecialFewestrevisions
* SpecialImport
* SpecialListgrouprights
* SpecialMediaStatistics
* SpecialMergeHistory
* SpecialMIMEsearch
* SpecialMostcategories
* SpecialMostinerwikis
* SpecialMostlinked

Bug: T149346
Change-Id: Idee566dbff87f2e8bf909ba8371d551aaf0dd08b
2016-12-01 10:20:59 +02:00
Amir E. Aharoni
83fd11f17b Bidi-isolate revisions count in Special:Import
Change-Id: I3aacc10dd76aba9f4315db284a4bafe629219bc1
2016-09-30 11:29:21 +00:00
Siebrand Mazeland
ff6ad78546 Explicitly declare ImportReporter::reportPage() and override public
Used as such in SpecialImport.php.

Change-Id: Ia8cb1f4b95f43a50ff7ddd9aa4cb3ffc90f916c8
2016-03-08 16:13:36 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
georggi
280f07725e Hooks: Added ImportLogInterwikiLink hook
ImportLogInterwikiLink. Hook to change the interwiki link used in log entries and edit summaries for transwiki imports.

Change-Id: I03e054de16d8820c0f3d2c165288e229960d6bb1
2016-01-16 13:05:17 +02:00
Aaron Schulz
7798b70e7e Define which SpecialPage classes expect write vs read mode
Bug: T123591
Change-Id: I521ebdd5e8eb8f7f4df927dc38732170aef2ac19
2016-01-14 14:40:37 -08:00
umherirrender
dc78d4d12c Move details of import logs into log params
The detail information about the count of revision and the interwiki
title get moved into log params. To show the new information an
ImportLogFormatter was written, which changes the key for new log items.

This allows to show the detail information in the user language.
It also decouple the user supplied data from detail information

Change-Id: Iaa57da0fc3e20c33c94fd850cd02db96fdb32dac
2015-11-11 18:34:18 +01:00
jenkins-bot
70e760ee4e Merge "Add hook to allow lazy loading of import sources" 2015-09-23 16:30:36 +00:00
This, that and the other
d3b85592ea Add hook to allow lazy loading of import sources
Currently import sources have to be set into $wgImportSources as part of
wiki startup. This is not practical for the WMF cluster, where we need some
reasonably complex logic to set up the import source structure.

This change allows the import source list to be populated from a new
"ImportSources" hook. This hook is only called when the list of import
sources is actually needed (namely, when a user with relevant permissions
loads Special:Import).

Bug: T17583
Change-Id: Ice9a19cb6dfe53ae72aa71353d0553ee9338f233
2015-09-23 17:54:31 +10:00
Aaron Schulz
9bba2d169e Added wfTransactionalTimeLimit() method and applied it
* Potentially long running POST requests often use multiple transactions,
  talk to multiple services, or defer updates. Try to make sure they have
  a chance to complete all of the work. WMF already sets ignore_user_abort()
  across the board in config, but this applies it to key spots for all
  installs, in addition to bumping the time limit. 
* Eventually this can lower the need for high overall time limits.

Bug: T102890
Change-Id: I893ddd773064dcd63b5b24c84c6391974f4b5aee
2015-08-12 22:09:40 +00:00
Federico Leva
8d08910bfa Add help link for 8 more special pages
* Links can now be customised on-wiki via system message:
  e928d5bdd0
* Most help pages chosen here are good for any MediaWiki install
  and have been imported on MediaWiki.org. Their license has been
  noted in the appropriate template, only future contributions
  will be in public domain (CC-0) unless we reach old authors.
  An update/discussion was opened at the project talk:
  https://www.mediawiki.org/wiki/Project_talk:PD_help
* The 6 pages on MediaWiki.org have been marked for translation;
  import of previous translations is ongoing. 2 pages are left on Meta
  because importing translatable pages with all translation units may
  be overkill.

Bug: T45591
Change-Id: I5dd91a0b7233556f2da06b65205fee72ea65a55f
2015-05-15 11:25:27 +00:00
This, that and the other
1fe98feab0 Make import destination UI more intuitive and clearer
Previously there were two fields: Destination namespace, and Destination
root page. They were both optional, and the "root page" one in particular
was a bit mysterious until you tried it out. In addition, there was a
strange interaction when you set both fields (I still don't quite
understand what used to happen in this case).

Now, there is a set of three clearly described radio buttons, allowing the
user to select whether to import pages into their automatically chosen
locations, into a single namespace, or as subpages of a given page. These
correspond to the three ImportTitleFactory classes available in MediaWiki.

See https://phabricator.wikimedia.org/M28 for a screenshot.

The logic of WikiImporter#setTargetNamespace is tweaked slightly to remove
the interaction between target namespace and target root page, since only
one of these options can now be set. Similarly, the API's import module
is modified in the same way.

Bug: T17908
Change-Id: I11521260a88a7f4a95fbdb71ac50bcf7b4fe5cd1
2015-04-22 18:46:40 +00:00
umherirrender
4f60a37d4e Migrate import log to new log system
There is no need for an extra formatter class, because at the moment
there is nothing extra to format.

This allows use of gender on Special:Log. Old messages are kept for use
in IRC. A test was added to ensure an unchanged IRC message.

The new log message for import-interwiki is used from
I3ca8b21bce49b41cac7109efb8056ca4469b88d7 to avoid "transwiki jargon".

Bug: T57404
Change-Id: I590075b203548c071a98c1eaa4b1bc9250f60e22
2015-03-18 13:21:52 +00:00
Aaron Schulz
6921770414 Updated some try-catch statements: MWException -> Exception
Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
2015-01-09 17:20:22 -08:00
jenkins-bot
9581677601 Merge "Proper namespace handling for WikiImporter" 2015-01-05 22:40:15 +00:00
Reedy
4d9143c7f5 Add lots of @throws
Change-Id: I09d0c13070f966fcf23d2638d8fc1328279a5995
2014-12-24 13:49:20 +00:00
Kunal Mehta
b7796a0deb SpecialImport: Don't access $this->getConfig() in the constructor
The context is only set later on, so call it in the main
execute() function.

Bug: T73376
Change-Id: I34229877df6a8960756565f7df1d680aa8951cba
2014-12-19 17:27:35 +00:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
This, that and the other
37b4cd5da2 Proper namespace handling for WikiImporter
Up until now, the import backend has tried to resolve titles in the XML
data using the regular Title class. This is a disastrous idea, as local
namespace names often do not match foreign namespace titles.

There is enough metadata present in XML dumps generated by modern MW
versions for the target namespace ID and name to be reliably determined.
This metadata is contained in the <siteinfo> and <ns> tags, which
(unbelievably enough) was totally ignored by WikiImporter until now.
Fallbacks are provided for older XML dump versions which may be missing
some or all of this metadata.

The ForeignTitle class is introduced. This is intended specifically for
the resolution of titles on foreign wikis. In the future, an
InterwikiTitle class could be added, which would inherit ForeignTitle
and add members for the interwiki prefix and fragment.

Factory classes to generate ForeignTitle objects from string data, and
Title objects from ForeignTitle objects, are also added.

The 'AfterImportPage' hook has been modified so the second argument is a
ForeignTitle object instead of a Title (the documentation was wrong,
it was never a string). LiquidThreads, SMW and FacetedSearch all use this
hook but none of them use the $origTitle parameter.

Bug: T32723
Bug: T42192
Change-Id: Iaa58e1b9fd7287cdf999cef6a6f3bb63cd2a4778
2014-12-10 22:24:47 +11:00
jenkins-bot
80eeea984a Merge "Import.php: Use Config instead of globals" 2014-10-30 22:42:00 +00:00
umherirrender
2a7c95acda Fixed spacing
- Changed spaces to tabs for indentation
- space after 'function'/'if'
- Added/Removed space after parenthesis/brackets/end of line
- Removed space after cast

Change-Id: I0e8e6a19b84b5e1308b632a0266cb78f688494ee
2014-10-30 17:50:19 +01:00
Kunal Mehta
4a2ecaa046 Import.php: Use Config instead of globals
Change-Id: I4d1a8c443cfa360c5d388364c580d48fa7124099
2014-10-22 10:35:29 -07:00
This, that and the other
5ed380bed5 Preserve log comment text field value across import attempts
This was first attempted way back in r45340, but was reverted in r45489.

Bug: 16793
Change-Id: Ieb9fb7e7e918b2e7e2b8289b3fdf82a49ea75a17
2014-10-01 18:35:44 +00:00
umherirrender
63dc5abc9a Fixed spacing
- Added space after reserved words: function, foreach, if
- Combined 'else if' into elseif
- Added braces to one-line statements
- Added spaces after comma, before parentheses

Change-Id: Ie5bbf680d6fbe0f0872dab2700c16b1394906a72
2014-08-27 18:31:50 +02:00
This, that and the other
569c3e862b Allow two-tier setup of transwiki import sources
There has been some demand, particularly in the Wikimedia cluster, for the
ability to import from any wiki of a cluster. For this to occur, the
transwiki import user interface needs a bit of a rethink.

This patch replaces the existing single dropdown with a pair of dropdowns:
the first to select the wiki project, and the second to select the
subproject (e.g. a Wikipedia/Wiktionary language, or a Wikia site).
The second one is optional (to support single-wiki sites like Meta, or
for backwards compatibility with existing setups).

$wgImportSources is now treated as a mixed array/associated array (see
comment in DefaultSettings.php). Existing configurations will still work
but will receive no new functionality.

The non-JavaScript fallback is not pretty, but (a) it works, (b) I don't
see an easy way to make it nicer, and (c) wiki sysops should probably be
using a JavaScript-enabled browser for admin actions like importing...

The intention is to alter the WMF configuration to automatically populate
$wgImportSources with all public cluster wikis. I'm not exactly sure how
this will be set up, but this patch is an important first step. I expect
some non-WMF users of MediaWiki will find it helpful as well.

Change-Id: Icdb655500c1ae5374dc7a9f4d99e6738b2269b14
2014-08-19 21:59:27 +10:00
umherirrender
c2de24efcd Add missing @param to function docs
Change-Id: Ib7ac94d05a04490f25dfd40b46b27973cbab582c
2014-08-14 19:38:57 +00:00
Kunal Mehta
ee9a2dccbe SpecialImport: Use Config instead of globals
Change-Id: I1903a50d0a2f75cd4e6e78d6da3c41172be4898f
2014-08-09 00:10:28 +00:00
Siebrand Mazeland
2c10a13c64 Pass phpcs-strict on includes/specials/ (2/3)
Change-Id: Ide979e5b948115afcec59d929516411c2e8346ae
2014-05-10 14:17:32 +00:00
umherirrender
26e705f808 Add $user param to Revision::newNullRevision
This avoids the use of $wgUser in Revision constructor and makes the
dependency on the global visible.

Change-Id: Ib67bd706a3c4ef081f475406e9aa1094c42222ef
2014-04-28 18:59:20 +02:00
umherirrender
f971300427 Fixed some @params documentation (includes/[specialpage|specials])
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: Icf6f36bb53322b39cd5c89523dbd0e4ab10b9ec9
2014-04-19 10:16:52 +02:00
umherirrender
23fab68274 Fix spacing after @param and friends in comments
Searched for:
\@(param|return|throws|since|deprecated|access|todo|var)[ \t]{2,}

Change-Id: Icce22ba9fe0635455691ca58d9872d618151f346
2014-04-05 20:02:29 +00:00
Ladsgroup
a90f1a2d79 Changing URLs of mediawiki.org in scripts to the SSL-based website
http://www.mediawiki.org --> https://www.mediawiki.org

Part 3

Change-Id: Ica633881b1744fa2854f4b012b79dbf5a7e5e7e2
2014-03-13 22:28:14 +00:00
Kunal Mehta
bc798535fd Deprecate SpecialPage::getTitle
Callers should use SpecialPage::getPageTitle, which is
exactly identical.

This is so that in the future we can turn SpecialPage
into a ContextSource, which requires getTitle to return
getContext()->getTitle.

Change-Id: Icdcf5d5295ef5e7f08b1d403e0c123f78738fd40
2013-12-24 12:53:11 -08:00
umherirrender
5dbfd5bf80 Fixed spacing
- Removed trailing spaces in comments
- Removed multiple empty lines
- Removed space after object operator

Change-Id: I9fd3256ab490c7cd2034de3fd94e6be6e6d6d8f2
2013-11-21 18:52:25 +00:00
umherirrender
d8c1083e04 Always pass user to LogPage::addEntry
This avoids getting $wgUser in LogPage::addEntry

Change-Id: Ie105cef4ebc3d69aeaef5ee40ce6ee0087a74c69
2013-09-13 21:14:36 +02:00
Siebrand Mazeland
87ec7ad22e Update formatting
Change-Id: I0e334d910a311f067276215b6bff94cd814fc3b3
2013-04-20 10:02:19 +02:00
umherirrender
15abcf71ca Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
2013-04-13 13:36:24 +02:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01:00
umherirrender
96a5486ed0 Add SpecialPage::getGroupName and use it
Having all group mapping for Special:SpecialPages in the global
$wgSpecialPageGroups is not a good OO style.
Created a method SpecialPage::getGroupName, which than can be overridden
by each subclasses to the featured group name.

Added also SpecialPage::getFinalGroupName to get the groupname on
Special:SpecialPages to handle the customization and
to keep $wgSpecialPageGroups for b/c

Change-Id: I1de3a186f0a59ec5ecb8996c5f805cf164e9637f
2013-03-07 21:15:54 +01:00
umherirrender
48cd72819e fix some spacing
Change-Id: Ia9650be8b791fd2f0ccbc099436918a9d12d9968
2013-02-04 20:04:26 +00:00
umherirrender
453264f904 fix some spacing
Change-Id: I2a59eb22bb8acf01b560507a48d6be55d9c87de7
2013-01-31 20:06:37 +00:00
umherirrender
824fad9956 fix some spacing
Change-Id: I78a97ad87e0bfe724fc851daf6ffeeed81887800
2013-01-26 19:15:35 +01:00
Alexandre Emsenhuber
30df62d335 Follow-up I9c7aa3b2 (b28c7a8): fix one more validation error
"size" attribute of <input> is not allowed when type is "file".

Change-Id: Id8291d2c2e2ddc3e0c462c0eaa3817634d088c6b
2012-12-27 19:49:41 +01:00
umherirrender
b28c7a8adc Fix some validation errors on Special:Import
Fixed errors are:
* Duplicate ID mw-import-table
* Duplicate ID mw-interwiki-rootpage
* The for attribute of the label element must refer to a form control
(2x)

Added also a id for another input element for easy user scripting

Change-Id: I9c7aa3b2af2d49cf3aed42a057ab13aa1275ee90
2012-12-27 17:26:24 +01:00
umherirrender
e421c99e87 Allow importing pages as subpage
Adding a "root page" input to Special:Import, which is used as prefix
before each imported page. With this option, it is possible to import
pages as subpage of a user or a project page.

On de.wp the import is often done into a low used namespace (100 or 101)
and than moved to the user space. Doing this in one step, makes things
easier.

Change-Id: Id5dbf742295a1bbddd8cb6eaa09fb28051f26613
2012-08-15 10:10:46 +02:00
umherirrender
e82e043c2d Move message importtext into the fieldset
Than it is the same place as message import-interwiki-text

Change-Id: I0eb800b05848cbea123f895180da02cc1b9af913
2012-08-06 18:03:19 +02:00
Alexandre Emsenhuber
f267f37320 Change calls from Xml::namespaceSelector() to Html::namespaceSelector() since the former now throws deprecation warnings... 2012-03-19 12:30:52 +00:00
Sam Reed
b18ea7dee2 Normalise casing of getArticleID used in core 2012-03-11 18:54:55 +00:00
Alexandre Emsenhuber
ca36f19254 * Pass number with numParams() to Message object and let that object format the number
* Added missing escaped() call from my last commit
2012-03-01 21:29:11 +00:00