Commit graph

21 commits

Author SHA1 Message Date
Brad Jorsch
11cf01dd9a Add comment table and code to start using it
A subsequent patch will remove the old columns.

Bug: T166732
Change-Id: Ic3a434c061ed6e443ea072bc62dda09acbeeed7f
2017-08-30 15:05:00 +10:00
Bartosz Dziewoński
8785e4a5b3 Replace remaining uses of deprecated DB_SLAVE with DB_REPLICA
Change 950cf6016c took care of the most,
but a few remain, either outside of includes/ and maintenance/
directories (which that change was limited to), or in code introduced
afterwards.

Change-Id: I9c363d0219ea7e71cde520faba39406949a36d27
2017-08-05 10:10:26 +00:00
Kunal Mehta
d1cf48a397 build: Update mediawiki/mediawiki-codesniffer to 0.10.1
And auto-fix all errors.

The `<exclude-pattern>` stanzas are now included in the default ruleset
and don't need to be repeated.

Change-Id: I928af549dc88ac2c6cb82058f64c7c7f3111598a
2017-07-22 18:24:09 -07:00
Brad Jorsch
1aac0a2992 Wrap parser output in <div class="mw-parser-output">
This will allow CSS to target just the parser output, without also
accidentally targeting the edit form, diff tables, and so on.

Bug: T37247
Change-Id: If4eb5bf71f94fa366ec4eddb6964e8f4df6b824a
Depends-On: I330c6aa4aaee045614b1801ed34bc9e03be69650
Depends-On: I52a518fa44e017841fe78474012cd69823e0a41d
2017-05-08 05:32:03 +00:00
daniel
e74264c071 Avoid joining against page table when finding a page's oldest revision.
Bug: T156537
Change-Id: Ifd27710cada823318ac3662d3c16323eb9a78839
2017-02-01 13:05:00 +01:00
This, that and the other
73224f4f8b User group memberships that expire
This patch adds an ug_expiry column to the user_groups table, a timestamp
giving a date when the user group expires. A new UserGroupMembership class,
based on the Block class, manages entries in this table.

When the expiry date passes, the row in user_groups is ignored, and will
eventually be purged from the DB when UserGroupMembership::insert is next
called. Old, expired user group memberships are not kept; instead, the log
entries are available to find the history of these memberships, similar
to the way it has always worked for blocks and protections.

Anyone getting user group info through the User object will get correct
information. However, code that reads the user_groups table directly will
now need to skip over rows with ug_expiry < wfTimestampNow(). See
UsersPager for an example of how to do this.

NULL is used to represent infinite (no) expiry, rather than a string
'infinity' or similar (except in the API). This allows existing user group
assignments and log entries, which are all infinite in duration, to be
treated the same as new, infinite-length memberships, without special
casing everything.

The whole thing is behind the temporary feature flag
$wgDisableUserGroupExpiry, in accordance with the WMF schema change policy.

The opportunity has been taken to refactor some static user-group-related
functions out of User into UserGroupMembership, and also to add a primary
key (ug_user, ug_group) to the user_groups table.

There are a few breaking changes:
- UserRightsProxy-like objects are now required to have a
  getGroupMemberships() function.
- $user->mGroups (on a User object) is no longer present.
- Some protected functions in UsersPager are altered or removed.
- The UsersPagerDoBatchLookups hook (unused in any Wikimedia Git-hosted
  extension) has a change of parameter.

Bug: T12493
Depends-On: Ia9616e1e35184fed9058d2d39afbe1038f56d7fa
Depends-On: I86eb1d5619347ce54a5f33a591417742ebe5d6f8
Change-Id: I93c955dc7a970f78e32aa503c01c67da30971d1a
2017-01-27 09:24:20 +00:00
Subin Siby
5eff86b740 Remove deprecated function Article::doEdit() and WikiPage::doEdit()
Bug: T61113
Bug: T154498
Change-Id: Ie6c1bb4ee5ee45ac2db432877a7038659231c091
2017-01-19 02:44:01 +00:00
Reedy
27f9e4af03 WikiPage::getText() was removed
Bug: T145728
Change-Id: I9e5ac149ad1780719b5c8f4e27048168cf33c0b9
2016-12-12 18:51:37 +00:00
Thiemo Mättig
00c3f09566 Remove empty lines from PHP and JavaScript comment blocks
This is a pure documentation change. It mostly removes empty lines from
comments (and entirely empty comments), as well as adds a few missing
documentation blocks and fixes a minor mistake. I hope it's ok to have
this in one patch. I can split it, please tell me.

Change-Id: I9668338602ac77b903ab6b02ff56bd52743c37c4
2016-12-09 09:01:06 +00:00
Reedy
ec6d6762ea Article::getAutosummary() and WikiPage::getAutosummary() were removed
Bug: T145728
Change-Id: I233571658b902c93a148a992ea99eb159551e732
2016-12-03 12:16:41 +00:00
Timo Tijhof
6aa6519293 page: Remove unused WikiPage::doQuickEditContent()
This is a rather hakcy method that bypasses various cache invalidation
updates. This method shouldn't be (and, fortunately, isn't) called
anywhere in Wikimedia Git.

Change-Id: I03ede077294344c420827e4a6527d4c5fc3509b0
2016-10-04 21:14:33 +00:00
Reedy
3c27ff94fa Replace WikiPage::doEdit() usages
Update/add some comments

Bug: T145737
Change-Id: Ib3b2b69906074cbb51917dc57204c989fd6c58b2
2016-09-15 21:25:32 +01:00
Florian
0f60a6d6ce Remove (WikiPage|Article)::replaceSection()
Bug: T122754
Change-Id: I1415c8de7be3b9d952fad265b439dd820e284fb2
Depends-On: I3d37f7e778d569970ed749c22ba49a63cc4ba0ec
2016-04-01 20:32:01 +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
addshore
96e1167d92 Give TestCase::checkHasDiff3 a better name
This method actually marks the test it is called
from as skipped if Diff3 is not confugured.

The new name "markTestSkippedIfNoDiff3" better
reflects that.

Change-Id: I1dffeba0aceb312b3a82216f0b55227e24bc2e34
2016-01-28 12:46:11 +01:00
Florian
0acebab76c Remove WikiPage::getRawText()
Bug: T122754
Depends-On: I29ec61c482057c5b3b1048c834aedac182174929
Depends-On: I74e57d8e76149b452a9635ad8a6eca91c3df96a9
Depends-On: Ia624ffeb2d9b1862f943f7c3103df417d90001c5
Depends-On: I4a5a0d34156f9aae09a3edbe736fd924bc74773f
Depends-On: I2355b7d4a1b831cd752cbaa88bf1878e0d5554fb
Depends-On: I02051f0c74b4db93093f171f1250c03b99f6cec6
Depends-On: Ie88d05a6534ac1d02fb79494603cea17108e6bb9
Change-Id: Ie3247a7143859bf10580e67cd5383d152540a25b
2016-01-13 20:45:23 +00:00
Reedy
48db568102 WikiPage::testPreSaveTransform() was removed
Change-Id: Ibce32556b8213a36876dcb4c6f385afa6e6875aa
2016-01-02 20:56:43 +00:00
Aaron Schulz
25d821830c Remove WikiPage::doQuickEdit
Change-Id: If56f790b8a29b2262cba0feff7a96312c69cdb0c
2015-11-04 02:15:40 +00:00
Aaron Schulz
c0cb80beac Added DeleteLinksJob to support purging backlinks via job runners
* This jobs should only be constructed via relevant Content object,
  e.g. the result of enqueueUpdate() being called on a DataUpdate
  returned by Content::getSecondaryUpdates().
* Also modified LinksDeletionUpdate to support a $pageId parameter.
* LinksDeletionUpdate can now be enqueued to a DeleteLinksJob.

Change-Id: I650dcf0bd172ede0d61357ec158a4704ae1f2033
2015-09-29 17:40:19 -07:00
Vivek Ghaisas
c54766586a Fix issues identified by SpaceBeforeSingleLineComment sniff
Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
2015-09-26 23:06:52 +00:00
umherirrender
1d8b52fbfd Move Test files under same folder structure where class is (/includes/)
Change-Id: I95f1aa6f0ed2cc3306aa6e588a11f359854315c1
2014-12-16 21:56:44 +01:00
Renamed from tests/phpunit/includes/WikiPageTest.php (Browse further)