Commit graph

30 commits

Author SHA1 Message Date
Brad Jorsch
993baa3493 ActorMigration: Remove possibility of read-both
When this was originally written, the plan was to read both the old and
new fields during the transition period, while stopping writes to them
midway through. It turns out that the WHERE conditions to do read-both
correctly are generally not handled well by the database and working
around that would require a lot of complicated code (see what's being
removed from ApiQueryUserContribs here, for example).

We can simplify things greatly by instead having it write both fields
during the transition period, reading from the old for the first part
and the new for the second part, as is being done for MCR.

Bug: T204669
Change-Id: I4764c1c7883dc1003cb12729455c8107319f70b1
Depends-On: I845f6ae462f2539ebd35cbb5f2ca8b5714e2c1fb
Depends-On: I88b31b977543fdbdf69f8c1158e77e448df94e11
2018-10-11 12:12:00 +11:00
petarpetkovic
b7a4e82545 Fix some of the common typos
* supress -> suppress (Except in backup_LogTest.php)
* recomend -> recommend
* becuase -> because
* accross -> across

Bug: T201491
Change-Id: I8faa4e6cc688b3ee204b3f79ab55eb7b65cc1fdd
2018-08-16 00:59:32 +02:00
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
Brad Jorsch
27c61fb1e9 Add actor table and code to start using it
Storing the user name or IP in every row in large tables like revision
and logging takes up space and makes operations on these tables slower.
This patch begins the process of moving those into one "actor" table
which other tables can reference with a single integer field.

A subsequent patch will remove the old columns.

Bug: T167246
Depends-On: I9293fd6e0f958d87e52965de925046f1bb8f8a50
Change-Id: I8d825eb02c69cc66d90bd41325133fd3f99f0226
2018-02-23 10:06:20 -08:00
Kunal Mehta
0cb2a09b6d Always put type information before variable name for @var tags
Like other tags, @var should have the type information before the
variable name.

<https://docs.phpdoc.org/references/phpdoc/tags/var.html>

Change-Id: I9eca6957b1990fa8cc687103dc02ee38af5f9086
2017-09-04 11:06:51 -07:00
Umherirrender
ace44e2064 Use correct variable name in @param documentation
For some varargs a variable name is added with suffix ,... as seen for
many other varargs

Some @param are swapped, because there are in the wrong order

Enable Sniff MediaWiki.Commenting.FunctionComment.ParamNameNoMatch

Change-Id: I60fec6025bce824d5c67563ab7b65ad6cd628ad8
2017-08-11 19:27:19 +02:00
WMDE-Fisch
ae3419f532 Replace some of the deprecated wfGetLBFactory() calls
Change-Id: I87aa0ebe273706438f1634167de8c60f51432878
2017-02-07 14:41:09 +01:00
Justin Du
81b9324620 Add tagging support to imagerotate, revisiondelete, and tag API modules
Adds a tags parameter. This allows a user with the applychangetags right to tag the log entry corresponding to the action.

Bug: T97720
Change-Id: I11418d22ee780944e92d82e32b271b8276c396bf
2016-12-31 11:45:18 -06:00
Aaron Schulz
a2790b1b80 Remove wfGetCaller() dependency from DatabaseBase
Change-Id: I3e240b2eb5c1f6a21f1bc974c3d28f5755c7451a
2016-09-15 14:40:00 -07:00
Aaron Schulz
32a8eb1822 Make various MWCallableUpdate usages rollback-safe
Support for this added to MWCallableUpdate and its helper method
in DeferredUpdates.

Bug: T141988
Change-Id: Ief150ea655036e2708557dd8ae847379edf21933
2016-08-15 00:47:42 -07:00
jenkins-bot
d4f1e00a0c Merge "Make revision deletion acquire file locks to avoid races" 2016-07-27 00:47:03 +00:00
Aaron Schulz
d217cdf4b5 Make revision deletion acquire file locks to avoid races
Also made RevisionListBase an Iterator to avoid ugly loops here

Change-Id: I40d2d8cf63df95c59d0e1275e3ec45aff238e1cb
2016-07-26 16:32:15 -07:00
Aaron Schulz
3a922d36d8 Convert onTransactionIdle() callers to DeferredUpdate subclasses
* This puts the complex logic here after the commit step for
  all DBs, making the main multi-DB transaction more likely
  to be atomic. Previously, the idle callbacks could be hit
  bewteen DB commits.
* Enforce transactionality via AtomicSectionUpdate.
* Use $this instead of $that hacks for old PHP versions.

Change-Id: Idf7d54fdac6487f86907099680f5c1c4f5530b4e
2016-07-25 16:49:15 -07:00
jenkins-bot
e5e7d75a16 Merge "Avoid calling rollback() in setVisibility() when nothing changed" 2016-07-22 17:40:59 +00:00
Aaron Schulz
a68de43285 Avoid calling rollback() in setVisibility() when nothing changed
Change-Id: I7fde64fe1e6c9553447bcb9e62a1a9530f9e52ce
2016-07-21 18:42:48 -07:00
Aaron Schulz
6bbbb27446 Make non-exception rollback() calls safer
Use rollbackMasterChanges() instead so that all DBs get reverted.
Otherwise, external DB updates may get committed while related local
DB changes are rolled back.

Change-Id: I74de77f4b12dc15c0473c272d090caeeb97d6983
2016-07-21 18:10:43 +00:00
Andrew Otto
ee75aa9bee Add $visibilityChangeMap parameter to RevDelList doPostCommitUpdates
This paramater contains a map of id => old and new visibility bits.
This allows doPostCommitUpdates to do something useful with the
differences before and after a visibility change.  Specifically,
RevDelRevisionList doPostCommitUpdates passes this to the
ArticleRevisionVisibilitySet hook.

Bug: T137287
Change-Id: I1824f56d2aadc15671c442cf30dc1f9f01e821f8
2016-07-06 10:36:08 -04:00
Aaron Schulz
f8f60f3926 revisiondelete: Fix $oldBits/$newBits usage in setVisibility()
This addresses the FIXME comment around updateLog()

Change-Id: Iedb9df0b4cf65308a6b58bd9d9295d1850bc2c28
2016-06-03 23:04:27 +00:00
Aaron Schulz
95ed38a0f3 Clean up setVisibility() log type logic
The log type used should be based on whether any item
was (un)suppressed, not just the last log entry. Otherwise,
unsuppression could end up in the wrong log if the last
item in the list was not unsuppressed but others were.

Change-Id: I7b6af524cc45a1d83b2b719bfa00138531455e35
2016-06-03 22:08:21 +00:00
Leszek Manicki
1588e2f279 Add a type hint to RevDelList::setVisibility
Docblock mentions an array already. All usages in core I've managed
to track also pass in arrays.

Change-Id: I830f446a2b63d09c7aa81205d66ac56d8bdab733
2016-04-27 16:57:28 +02: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
Brad Jorsch
d9ebccb86d SECURITY: RevDel: Check all revisions for suppression, not just the first
If any of the revisions in the list are deleted, do not allow changing
the permissions without suppressrevision.

Bug: T95589
Change-Id: Ia8a3ef13b73925d14a79775a50d46b939c01664f
2015-10-16 14:11:20 -07:00
Alex Monk
8682b8b90e Purge remaining oversight references from code
i18n change coming in a separate commit

Change-Id: I46b9311cd01e95e524587ce40dcbae62f58dc5a8
2015-09-16 18:21:44 +00:00
Aaron Schulz
4161843d87 Cleaned up various revisiondelete IDE warnings
Change-Id: I4750eabf9985785520aaac8eca12d488ca746966
2015-05-29 21:40:36 +00:00
Aaron Schulz
52e1947dcd Actually set the $res field via doQuery() in setVisibility
* Otherwise, it is thrown away and redone on a slave

Change-Id: I1252fa5bc98d908cf289f4d93cbdd8d6d33828ea
2015-05-23 10:58:09 -07:00
Aaron Schulz
c1bc0e447c Added $res var docs for RevisionListBase
Change-Id: Ib71b9c662e68b64f1c6ad07c1902ed8ed432f175
2015-05-23 13:08:12 +00:00
Aaron Schulz
777cf7c291 Switched RevDelList to using start/endAtomic()
Change-Id: I2c950b558390e3fd9917414998f576e4e3b0593d
2015-04-09 11:17:03 -07:00
umherirrender
8089580c62 Use new log system when create log entry for revision delete
The actions delete/event and delete/revision was not using the new
LogEntry to create the log row, changed this.

All params gets a number to avoid too many changes in DeleteLogFormatter
to keep the old and new format working.

Needs extra code for api to keep the output format unchanged.

Change-Id: Ic149960f797d05fd088fa014390d791e3ae08687
2015-02-07 20:05:13 +00:00
Ricordisamoa
fc5fd5c37a Typo fixes and non-code tweaks
Skipped replacements:
* prefered → preferred
* prolly → probably

Skipped files:
* resources/lib/jquery.ui/jquery.ui.mouse.js
* resources/lib/jquery/jquery.form.js

Change-Id: Ib7923f362ddfca1b892bf5d601785d6b5aa5d44c
2014-12-12 18:31:15 +00:00
umherirrender
fbba43358e Split RevisionDeleteAbstracts.php to separate files
Same as I244a66fe19c089df4bcabcf745536d99b2103bc4

Change-Id: I90cea070a8e24d82f0675f122c79326988351e08
2014-08-20 19:08:33 +02:00
Renamed from includes/revisiondelete/RevisionDeleteAbstracts.php (Browse further)