Commit graph

482 commits

Author SHA1 Message Date
Amir Sarabadani
ac5166d343 Make RCCacheEntry use the local part of the user name for linking
Bug: T190530
Change-Id: Ib9e555c65fbe9befdb8413e6fbc3b3a53614bad8
2018-05-22 22:27:18 +00:00
Aaron Schulz
b6cd5421b9 rdbms: rename onTransactionIdle() to onTransactionCommitOrIdle()
This is clearer and is consistent with onTransactionPreCommitOrIdle()

Change-Id: I3a34a0e9adea69ec55ed6ddfef47703e31e7c3b5
2018-05-09 21:07:06 +00:00
jenkins-bot
c2f9376c19 Merge "RecentChange: Use constants for the $noudp parameter of save()" 2018-04-30 19:47:24 +00:00
Timo Tijhof
eca112b4e0 RecentChange: Use constants for the $noudp parameter of save()
It is a boolean parameter that is confusing for three reasons:

* It's a boolean parameter, given parameters are unnamed in PHP,
  these are always poor UX for call sites.

* It's negated ("noudp"). save(true) means no feeds events,
  save(false) [default] means sending events to feeds.

* To overcome this problem, typical use was to pass a free-form
  string that self-documents the intended behaviour,
  e.g. `save('pleasenoudp')`, any string casts to true.

Fix this by moving the booleans to constants and use those
instead. For compatiblity, keep the negation internally,
although it's hidden from regular usage. Also document
the string hack, deprecate it, and update callers.

Change-Id: Ia57c86b38bf50cb4ec580f42a6b1ca798fcf781a
2018-04-27 22:23:52 +00:00
Roan Kattouw
f841e886b6 Use PRC_AUTOPATROLLED for log entries and category entries
These actions mark edits as patrolled automatically, so the
correct rc_patrolled value to use is PRC_AUTOPATROLLED rather than
PRC_PATROLLED. The code for log entries checks the autopatrol right, and
the code for category entries has a comment that says "just like log
entries".

Bug: T190408
Bug: T184791
Change-Id: Id994af8cd3833a862a09389431256aba35c2e6d9
2018-04-26 11:21:48 -07:00
Amir Sarabadani
922be51066 Remove the feature switch for disabling autopatrol logging
Per the RFC, it will now become the default and only behaviour
to not log autpatrol actions. The information is already
recorded via the rc_patrolled field.

Bug: T184485
Change-Id: I98ae895a2b4cde4bb945f1df23be4a070b0bf9c4
2018-04-13 20:52:53 +00:00
Amir Sarabadani
00a4f0939c Replace rc_patrolled values with contants, part I
This constants has been recently introduced and it's good to use them

Change-Id: I8ce56dc95de3e49610dca71c00965ca1ac74bcf0
2018-04-11 22:35:31 +02:00
Amir Sarabadani
728321e113 Make autopatrol third option in rc_patrolled and use it in API
Bug: T184791
Change-Id: If64ba8b845b122a87f20646dddf72ef257b793cb
2018-04-03 18:44:37 +02:00
Matěj Suchánek
85b8aed11b Ensure whether user can rollback page in ChangesList
This is already done in Special:Contributions.

Bug: T50731
Change-Id: I2a608f32c90ff0c06c92937b5edf0ee000ca8aba
2018-03-22 21:09:05 +01: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
jenkins-bot
6f7e982df6 Merge "Only try to show character difference if it isn't empty" 2018-02-14 17:31:33 +00:00
Reedy
39f0f919c5 Update suppressWarning()/restoreWarning() calls
Bug: T182273
Change-Id: I9e1b628fe5949ca54258424c2e45b2fb6d491d0f
2018-02-10 08:50:12 +00:00
addshore
e5879da149 Pass $key into CommentStore methods and use MediawikiServices
This allows CommentStore to be added to MediaWikiServices
without the need of an aditional Factory.

This change includes a compatability layer to allow the behaviour
from 1.30 to continue to be used while deprecated.

CommentStore::newKey has been deprecated.
Keys are now passed into the public methods of CommentStore
where needed.
The following CommentStore methods have had their signatures changed
to introduced a $key parameter, but when used in conjunction with
CommentStore::newKey behaviour will remain unchanged:
  * CommentStore::getFields
  * CommentStore::getJoin
  * CommentStore::getComment
  * CommentStore::getCommentLegacy
  * CommentStore::insert
  * CommentStore::insertWithTemplate

Change-Id: I3abb62a5cfb0dcd456da9f4eb35583476ae41cfb
2018-02-05 15:34:12 +00:00
Umherirrender
3124a990a2 Use ::class to resolve class names in includes files
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: I07a925c2a9404b0865e8a8703864ded9d14aa769
2018-01-27 20:34:29 +01:00
Timo Tijhof
bee9f4db96 Remove various redundant '@license' tags in file headers
Redundant given this is the project-wide license already,
especially in file headers that already include the GPL license
header.

This and other minor fixups based on feedback from Ie0cea0ef5027c7e5.

* Add @file where missing.
* Move @ingroup and @deprecated from file to class doc where needed.

Change-Id: I7067abb7abee1f0c238cb2536e16192e946d8daa
2018-01-12 18:15:11 +00:00
Thiemo Mättig
ef470ebf7f Remove @param comments that literally repeat what the code says
These comments do not add anything. I argue they are worse than having
no comments, because I have to read them first to understand they
actually don't explain anything. Removing them makes room for actual
improvements in the future (if needed).

Change-Id: Iee70aad681b3385e9af282d5581c10addbb91ac4
2018-01-10 14:14:26 +01:00
mainframe98
70e92cdad5 Fix additional usage of incorrect case
Courtesy of the PhpStorm inspection Case mismatch in method call or
class usage.

Bug: T166759
Change-Id: I27c53658b99048fa0dd8f9d6ef1398620386e1cc
2017-12-15 11:58:11 +01:00
Aaron Schulz
c8d82c02c3 Use WANObjectCache::makeKey() in ChangesFeed
Change-Id: Ia029873e5d0883d177007555ad494cae9e00c407
2017-11-27 12:03:47 -08:00
Aaron Schulz
bb462e5193 Fix some broke cache key generations
Change-Id: Ib724fe0cfa866351caee89d3451b6c4b7b6a4578
2017-11-19 21:30:45 -08:00
Max Semenik
72b15b96e7 Fix function annotiation
Change-Id: I4dfc62c8ef2226b46aa1eed508816377f6599ab2
2017-11-04 00:35:39 -07:00
Brad Jorsch
c2f432625f Add deprecation notices for selectFields() methods deprecated in Idcfd1556
Now that WMF-deployed extensions have been updated to no longer call
them.

Change-Id: I04942ca1b95baa2126f2dcf4d0975536f4dd07c7
Depends-On: I300130c7b952a353ac28989d39d7f01366da2a37
Depends-On: Ia81bf6a655af800ce8ac19940d851e65746e1f77
Depends-On: I0d869aacaaad85cdd34361a611ac8348bdbb757d
Depends-On: I7b05a99e23da296a673eb0bd34f18344618c8be3
Depends-On: I42237e8e29497bbc56606f6ad01de3d525bf8b2a
Depends-On: If75d2e76c2f166bc40a544dd502da43171ce1e7b
Depends-On: I401809d2638b11e6c77a318fc8fbbc41fa639083
Depends-On: I5d62ad76fdb64a9c6efd228f27e9b5f512f17d5e
Depends-On: I488afaa991e3d26b638a4f588f70db455959eadf
Depends-On: Ibe82dadb0f2d1c5dbc38b96731c6e443c5469ff0
Depends-On: Id25b86dd415e2e3c6190a91faee2a3b815e50f61
2017-11-01 14:50:56 +00:00
Brad Jorsch
3488f49532 Replace selectFields() methods with getQueryInfo()
Several classes have a "selectFields()" static method to tell callers
which fields to select from the database. With the recent comment table
change and the upcoming actor table change, this pattern has become too
simplistic as a SELECT will need to join several tables to be able to
retrieve all the needed fields.

Thus, we deprecate the selectFields() methods in favor of getQueryInfo()
methods that return tables and join conditions in addition to the
fields.

Change-Id: Idcfd15568489d9f03a7ba4460e96610d33bc4089
2017-10-30 22:57:33 +00:00
Stephane Bisson
b31c87ab91 RCFilters: define consistent interface in ChangesListFilterGroup
Get rid of isPerGroupRequestParameter and define a consistent
interface that all filter groups can implement.

Change-Id: Ib904bcdc697c65722a0041ac611d1e00c577389f
2017-10-18 12:44:51 -07:00
Stephane Bisson
4b82dc1bee RCFilters: Don't let new params filter out old page
Bug: T177884
Change-Id: Id0ace30b837cf6c5fa7159aa40d80392187c4e16
2017-10-16 15:56:37 -04:00
jenkins-bot
7d8766e80e Merge "RCFilters: Allows specifying default highlights from the server" 2017-10-04 20:58:42 +00:00
Stephane Bisson
8937a72df7 RCFilters: Allows specifying default highlights from the server
Bug: T172757
Change-Id: I0545b4e0222e14be99d567e7890ccf33722a5d1e
2017-10-04 13:51:23 -07:00
Stephane Bisson
dbc83d9c43 RCFilters: Avoid adding raw filter and group objects to js vars
Bug: T176236
Change-Id: I0c68ea0e090cfb065d2e3e8acad7025c61c344ca
2017-10-04 11:08:51 -04:00
Moriel Schottlender
a8497a3dd0 RCFilters: Output namespace class on log actions as well
Bug: T174732
Change-Id: Icaf7117d9566bb2bb31c69cf86078491d6c217cc
2017-09-13 17:18:11 -07:00
Moriel Schottlender
4596728148 RCFilters: Actually apply proper classes to grouped pages
Bug: T174734
Change-Id: Ie0a8f5587103c3caed31d29585db78017ac4ab4c
2017-09-13 10:22:25 -07:00
Umherirrender
f739a8f368 Improve some parameter docs
Add missing @return and @param to function docs and fixed some @param

Change-Id: I810727961057cfdcc274428b239af5975c57468d
2017-09-10 20:32:31 +02:00
Matthew Flaschen
91c2f9a6d5 RCFilters: Remove getValue and use FormOptions
Ensure the default is boolean, then FormOptions will
do the rest for us.

Bug: T174725
Change-Id: I92f2f77e1225f536a38f592578012855b948050c
2017-09-08 21:26:20 +00:00
Stephane Bisson
5e12ab58be WLFilters: Respect default values
Followup to I3e48a9f2d9b70f0b9f6d7c6329db9c8e8001ee49
Reported in T174725#3590145

Comparing current value and active value with
different representation ("1" !== true) leads to
not applying filters that are ON by default.

Bug: T174725
Change-Id: If083610c0294756589adfc32a59388cc7422ad5d
2017-09-08 10:01:00 -04:00
Mark A. Hershberger
4fd44dcd26 Note whether a category was added in a machine readable way
CategoryMembershipChange is great, but it doesn't have a
machine-readable way to see if the category has been added or removed
from the page. We could parse the comments, but that would rely on
reading the comments and matching the message against the translated
strings.

This patch adds a couple of parameters and notes whether the change
was an addition or removal in rc_params.

Also, puts the evaluation of the AbortEmailNotification hook before
the check of rc_type in the hopes that the extension CatWatch can send
out emails at the right time.

Bug: T175052
Change-Id: I3e2ac0cc148b9d618e2f8b7853b14bff827ee443
2017-09-06 09:03:54 +00:00
jenkins-bot
a17d459d4b Merge "Handle comment truncation in CommentStore" 2017-09-05 18:39:21 +00: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
Brad Jorsch
6ec1a31502 Handle comment truncation in CommentStore
Since the caller doesn't (and shouldn't) know whether CommentStore is
using the old or the new schema, it should leave truncation of comments
to CommentStore.

Change-Id: I92954c922514271d774518d6a6c28a01f33c88c2
2017-09-01 15:03:45 -04:00
Brad Jorsch
01a10dba5a Remove reference to deprecated IDatabase->nextSequenceValue()
The method was deprecated and made unnecessary in Ib308190c.

Change-Id: I1729ac0b3a88270a4c2f064187a2472112aaeb1e
2017-09-01 12:28:39 -04:00
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
Stephane Bisson
ba86bd1d64 WLFilters: Use displaysOnUnstructuredUi instead of isVisible
Follow up I3e48a9f2d9b70f0b9f6d7c6329db9c8e8001ee49

Bug: T171134
Change-Id: Ife0b10265c34d2dfd9a4d234f4a5409382530cc9
2017-08-29 08:05:17 -04:00
Stephane Bisson
6314a9026f WLFilters: set default values
* Respect different default values for 'limit' and 'day'
  in RC and WL.

* Make 'latestrevision' respect 'watchlistextended'

Introducing 2 properties to ChangesListBooleanFilter
* activeValue: The value that defines when a filter is active.
  Most filters are active when they are set to 'true' but
  'extended' has no effect when it is 'true' and applies
  filtering when it is set to false.

* isVisible: Whether this filter is visible anywhere.
  'extended' is not visible in the legacy form but
  it is activated from preference or URL. When
  understanding form submission, it should not be assume
  to be 'false' when not present in the request.

Bug: T171134
Change-Id: I3e48a9f2d9b70f0b9f6d7c6329db9c8e8001ee49
2017-08-28 12:57:39 -04:00
jenkins-bot
72e689e843 Merge "RCFilters: Add marker between old and new changes in enhanced mode" 2017-08-17 05:56:42 +00:00
Geoffrey Mon
700e49dddd Unwatch link for pages in Special:Watchlist
When the 'watchlistunwatchlinks' preference option is enabled, this
adds a '×' link to each entry of the watchlist that unwatches the page
of that entry. When clicked, it changes into a '+' which can be used to
re-watch the page (effectively undoing the earlier unwatch).
When a page is unwatched, its entries and the entries of its associated
talk page (or vice versa) become translucent and are struck through.

Without JS, '×'/'+' link to action=(un)watch for the relevant page.

In addition, ChangesList classes have been modified to allow a prefixer
that adds a prefix to each line (used in this case to put the unwatch
link) and to add HTML data attributes to reliably determine the target
page of each entry. Unit tests have been updated accordingly.

Bug: T2424
Change-Id: I450b2901413d7e75c11de2a446829fdbb22d31e1
2017-08-12 19:36:29 -04:00
jenkins-bot
cc4115e87f Merge "Add missing @param and @return documentation" 2017-08-11 21:32:58 +00:00
WMDE-Fisch
6df9ed1ad6 update mediawiki-codesniffer to 0.11.0 and fix issues
- mostly auto fixes
- some too long lines fixed
- ignore amp space in one case  passing by reference

Change-Id: I6472f83bc3cbf4bd629d83050cc3319b19ec465c
2017-08-11 22:27:51 +02:00
Umherirrender
718e63694d Add missing @param and @return documentation
Change-Id: I1d1098eec3933df6561cceef646576013ddc08c8
2017-08-11 22:17:01 +02:00
Umherirrender
a9007e8baf Add missing & to @param documentation to match functon call
Change-Id: I81e68310abcbc59964b22e0e74842d509f6b1fb9
2017-08-11 18:47:46 +02:00
jenkins-bot
b5ddc3a4b4 Merge "Make phpcs pass" 2017-08-11 15:18:48 +00:00
Umherirrender
bf61a77431 Change @inheritdoc to @inheritDoc
Only @inheritDoc works for the Sniff
MediaWiki.Commenting.FunctionComment

Change-Id: I91fc02cda6701d790e4334fc2bc47f230955545c
2017-08-11 16:49:52 +02:00
Umherirrender
43e8cd0579 Make phpcs pass
Reenable MediaWiki.WhiteSpace.SpaceBeforeClassBrace.NoSpaceBeforeBrace,
because the mentioned bug is fixed

Bug: T172933
Change-Id: I1593bdba2295ebed401b921f2beabed69dba7638
2017-08-11 16:22:42 +02:00
Stephane Bisson
d65f49aa78 RCFilters: Add marker between old and new changes in enhanced mode
For both "Live Update" and "View newest changes", add a marker
between old and new groups when changes are grouped by page.

Bug: T163426
Change-Id: I00947d05e9b6022604a2a6b94eec94f6ed747c96
2017-08-07 14:52:42 -04:00
Stephane Bisson
e2bea6350c RCFilters: show new changes
When "live update" is off and new changes are detected,
show a link to load and prepend the changes to the list.

Also adding a line between old and new changes
when grouping by pages is off.

Bug: T163426
Change-Id: I6a111d23956bdc04caa4c71e9deede056779aafa
2017-07-31 08:50:09 -04:00
jenkins-bot
244e29b2c9 Merge "EnhancedChangesList: Don't render headings for empty days" 2017-07-25 12:55:18 +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
jenkins-bot
e72303c9f3 Merge "Remove auto-generated "Constructor" documentation on constructors" 2017-07-21 13:19:44 +00:00
Thiemo Mättig
91a920fd85 Remove auto-generated "Constructor" documentation on constructors
Having such comments is worse than not having them. They add zero
information. But you must read the text to understand there is
nothing you don't already know from the class and the method name.

This is similar to I994d11e. Even more trivial, because this here is
about comments that don't say anything but "constructor".

Change-Id: I474dcdb5997bea3aafd11c0760ee072dfaff124c
2017-07-21 12:19:30 +02:00
Roan Kattouw
11f9d532b4 EnhancedChangesList: Don't render headings for empty days
EnhancedChangesList renders an <h4> for every day, but it
does so before it starts rendering the changes for that day.
If all of the changes for a different day fail to render
(due to permissions issues, extension hooks, or whatever)
this would result in an empty heading.

Instead, render the heading after formatting is complete,
so that if all changes for a given day are dropped,
the heading is also dropped.

Bug: T171078
Change-Id: I8a0c6cbd679976d18d2c2e6e9ac972fb7b294a42
2017-07-20 11:38:52 -07:00
Roan Kattouw
59c94b1c9d ChangesListStringOptionsFilter: Make isSelected() respect ALL
ChangesListStringOptionsGroup::modifyQuery checks for ALL and
behaves accordingly, but isSelected() didn't. This broke conflict
detection when an entire non-full-coverage group was selected.

Bug: T162630
Change-Id: Ie241744201380ca5450d5edbb3eba971194f3df4
2017-07-17 16:52:51 -07:00
Umherirrender
b5cddfb27b Remove empty lines at begin of function, if, foreach, switch
Organize phpcs.xml a bit

Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
2017-07-01 11:34:16 +00:00
Umherirrender
be42e09aa8 build: Prepare for mediawiki/mediawiki-codesniffer to 0.9.0
The used phpcs has a bug, so the version 0.9.0 could not be enforced at the moment.
Will be fixed in next version, see T167168

Changed:
- Remove duplicate newline at end of file
- Add space between function and ( for closures
- and -> &&, or -> ||

Change-Id: I4172fb08861729bccd55aecbd07e029e2638d311
2017-06-26 17:14:31 +00:00
jenkins-bot
246bc1a78d Merge "Fix enhanced RC data attribute sanitizing" 2017-06-21 19:38:48 +00:00
jenkins-bot
7bb26739ec Merge "Add a message to localize strings like "2×" and use it in enhanced RC" 2017-06-19 18:50:35 +00:00
Gergő Tisza
94749fa62e Fix enhanced RC data attribute sanitizing
We push 'class' in the attribute array so the hook
can manipulate it, so it needs to be added to the attribute
whitelist as well.

Broken in I6dd006d0b1b0fd35c0020f0f9eea9113eca30b35.

Bug: T167922
Bug: T167535
Change-Id: Ic24400382a9dcbb990e12dfddae4ab7db14553cc
2017-06-15 00:02:44 +00:00
Moriel Schottlender
51ce88abb9 RCFilters: Add 'views' concept and a namespace view to RCFilters
Enhanced RCFilters: Add the ability to filter by namespaces to RCFilters.
	🎉	🎁	🎊

- Add the ability to separate groups of filters by 'views'
- Add the first views as 'default' (for predefined filters)
  and 'namespace' as the list of namespaces.
- Add 'nsinvert' to namespace group
- Allow highlighting namespaces
- Allow searching on either view, depending on prefix
- Add a way to switch views by typing prefix, clicking the
  'Namespaces' button or clicking a tag (either namespace
  or filter tag, changes the view accordingly, and adds
  or removes the prefix from the input to stay consistent)
- Add an optional wrapper text for tags, so we can represent
  them with their respective prefixes and (if needed) with
  a special message for inverted state.
- Add unit tests and make pass
- Bonus: Fix issue with URL not updating (and not being updated)
  the inverted and highlight enabled states.

Bug: T159942
Bug: T163521
Bug: T164130
Change-Id: I7e83f0800cbeb289dfd3461c1c5a197c053147ca
2017-06-14 12:57:13 -07:00
Gergő Tisza
016452cd09 ChangesList: Expose basic properties of lines as data attributes
We have several types of change lists (old RC/watchlist/related
changes, enhanced RC/watchlist, history) with slightly different
HTML, each with their own idiosyncracies. JavaScript code trying
to identify lines by log ID / revision ID has to jump through all
kinds of hoops to work with that.

To simplify the lives of frontend / gadget maintainers and provide
something approaching an API for these pages, we now expose the basic
attributes of each change line (revision ID for edits, log type/action
and ID for log events) as data attributes.

The OldChangesListRecentChangesLine, EnhancedChangesListModifyLineData,
EnhancedChangesListModifyBlockLineData, PageHistoryLine,
ContributionsLineEnding and DeletedContributionsLineEnding hooks
are updated accordingly. New hooks (LogEventsListLineEnding and
NewPagesLineEnding) are added for the change list pages which did
not yet have them.

Change-Id: I6dd006d0b1b0fd35c0020f0f9eea9113eca30b35
2017-06-08 23:19:45 +00:00
Matěj Suchánek
8ac0733115 Only try to show character difference if it isn't empty
When all grouped changes were categorization, the formatted character
difference was an empty string. This resulted in doubled separator.
In this case, we need to change it to false (like the code already
did with log entries).

Change-Id: Ic5cd82426985285809858ed67967bb2529bc31cb
2017-06-06 10:40:20 +02:00
Matěj Suchánek
0da36c5cab Add a message to localize strings like "2×" and use it in enhanced RC
Change-Id: I4fb651347a45f30e26bb6a49a565013fa91797ad
2017-06-06 08:50:25 +02:00
jenkins-bot
eb56a9255a Merge "Fix EnhancedChangesList::getDiffHistLinks null exception" 2017-05-21 12:28:57 +00:00
Brian Wolff
07fcf9909f Fix EnhancedChangesList::getDiffHistLinks null exception
If a page is deleted, rc_cur_id is missing, but it takes
a while before job queue deletes RC entries. If we encounter
something like that, just skip it since its bound for
deletion anyways.

Bug: T164059
Change-Id: I286109a9707e54939c0da31656ef54fd29acf481
2017-05-21 08:50:44 +00:00
Kunal Mehta
52a63f01b5 EnhancedChangesList: Use one TemplateParser instance
TemplateParser has an instance cache to avoid reading from APC
repeatedly for the same template, but that only works if the code uses
the same TemplateParser object.

Noticed while investigating T163154.

Change-Id: I645895a0965f7150e9a5aebc5a7788f27aa5a26d
2017-05-16 15:43:35 -07:00
Aaron Schulz
116cadb8bb Avoid postgres CategoryMembershipChangeTest failures
Strip out the redundant /32 CIDR suffix from the IP.

Bug: T75174
Change-Id: If7738ab46c72babb51d3c306ce749a9ccfe34740
2017-05-10 19:05:57 +00:00
Matthew Flaschen
d2c91eb0af Fix all the Doxygen for the RCFilters backend
All the lists and sub-lists now render correctly,
and missing parameters have been added.

Bug: T163069
Change-Id: I7a8c95efaff7c844e32e4375dfe6af8c2e91923f
2017-05-03 18:52:06 -04:00
Matthew Flaschen
7c161ad4c6 Document "What's This" group UI feature
Bug: T163069
Change-Id: I1100dbea1549ee208dc0a1e9bcd56d8c93775302
2017-05-02 16:06:37 -04:00
Stephane Bisson
93cbb2450c RC Filters: Detect filters conflicts to by-pass db query
Filters are in conflict when their combination is guaranteed
to return no results. For instance: minor and log entries
is a conflict because major/minor does not apply to
log entries and the field is set to major by default.

Letting conflicts go through result in some very slow
database queries.

Bug: T160220
Change-Id: Ia6b0125c675c4a3cc4e4be4f83d1bd10d23059ba
2017-04-18 22:49:58 -04:00
jenkins-bot
9bfd0c324c Merge "RC Filters: Disable defaults for legacy filters in structured UI" 2017-04-12 21:48:10 +00:00
Fomafix
464f0c72a5 Remove multiple spaces in PHP files
Change-Id: Id9c26ec5ca730a9536f8fdccb8853eb03cbe87a4
2017-04-12 17:27:19 +02:00
Stephane Bisson
75a32fb5ec RC Filters: Disable defaults for legacy filters in structured UI
Some legacy filters are replaced in structured UI by new filters.
It's important that their default value doesn't cause them
to filter the results when they are not even visible to the
user.

Bug: T162158
Change-Id: I3ff09164bbc0d14283302aa37bdee2c7ef9f5eb3
2017-04-05 10:03:40 -04:00
Matthew Flaschen
cf463a4059 RCFilters: Remove isAllowedCallable and isAllowed
This is pretty fragile; it's easy to accidentally miss one of the
checks (as has already happened in e.g. parseParameters).

Although I don't yet know of any bugs as a result of this, it's
cleaner to do it at registration time.

There are no extensions using this feature.

Change-Id: I8547ea6432cae73e1bc272dbe959f2415b8a6d21
2017-03-31 01:49:44 -04:00
Aaron Schulz
488a647831 Move IDatabase/IMaintainableDatabase to Rdbms namespace
Change-Id: If7e8a8ff574661fd827de8bcec11d2c39a687300
2017-03-28 15:32:38 -07:00
Matthew Flaschen
2f6f69e834 RCFilters: Prevent duplicate filter names
Explicitly block two filters in the same group from having the same
name.

Before, it would be left to registerFilter, which would just cause
the second one to win.

Also, avoid a getFilter warning when the filter does not exist.
Do the same for getFilterGroup on ChangesListSpecialPage

Finally, a minor related doc fix.

Change-Id: I6b3880a5c7cc381c169bbd969cd4814559b49c91
2017-03-16 07:19:40 +00:00
Matthew Flaschen
d233035cb4 RCFilters: Don't allow underscore in filter or group names
This is reserved for the client-side which joins 'someGroup'
and 'somefilter' to make 'someGroup__somefilter' as an internal
ID.

Change-Id: I1b6ca9f337dd48e10705c46ef5027c3156254e01
2017-03-16 03:44:25 +00:00
Matthew Flaschen
aa063f4c5a Back-end of new RecentChanges page, refactoring
Generate old RC, Related changes (it was already displayed and working
on 'Related changes' before this change), and Watchlist/etc. and data
for new UI from back-end.

This moves everything used for defining the old (unstructured) and new
(structured) filters into unified objects, ChangesListFilter and
ChangesListFilterGroup (and sub-classes).

This includes the query logic (see below) and logic for adding
CSS attribution classes.

This is a breaking change (for subclasses of ChangesListSpecialpage)
due to the signature (and name) change of buildMainQueryConds and
doMainQuery.  An alternative that I don't think is a breaking change
would be to put the filter->DB logic in runMainQueryHook, but then it's
doing more than just running a hook.

This is because it used to only build $conds here, but it's clear from
filterOnUserExperienceLevel filters need more than this.  I added all
the DB parameters from the hook, but this could be debated.

I have an checked and fixed the WMF-deployed extensions affected by
this.

Other than that, there should be full back-compat (including legacy
filters not using the new system).

* add hidepatrolled/hideunpatrolled to new UI.

* Move userExpLevel from RC to ChangesListSpecialPage.  Although for
now the structured UI only displays on RC anyway, when it displays on
watchlist, it seems we'll want userExpLevel there.

  Change this to make 'all' exclude unregistered users.

* Don't have front-end convert none-selected to 'all' on string_options.

* Needs the hideanons/hideliu special redirect to be done before this
is merged (T151873)

Bug: T152754
Bug: T152797
Change-Id: Iec2d82f6a830403d1c948a280efa58992e0cdee7
2017-03-11 01:42:01 +00:00
Aaron Schulz
e01fd44388 Move ResultWrapper subclasses to Rdbms
Change-Id: I6f3f0e85e268b24c57c537aa6ad8016e0b4cdddb
2017-03-03 00:44:41 +00:00
Eddie Greiner-Petter
6a60a90ffb Add CSS classes for diff/hist links at Enhanced RC
CSS classes mw-changeslist-diff and mw-changeslist-history should be
added to diff and history links in recent changes. There is already a
patch for the old recent changes page, this one adds the same classes
onto the enhanced recent changes page (class EnhancedChangesList). As
enhanced RC has a lot more links, this patch introduces two new css
classes for some links, one named  #mw-changeslist-diff-cur which is for
the diff that links to a current version within nested changes and the
other named #mw-changeslist-groupdiff which is for the 'summary diff'
that appears for a group of nested changes.
Follow-up: I2d5ef8c180ae4ff6e7f5d0ab443dc7084f8c4c77

Bug: T157178
Change-Id: Ib51639a92b5925f2bad0aebd4f7068b178f65017
2017-03-02 17:41:31 +00:00
Stephane Bisson
029dc81f41 RC Filters: in enhanced RC mode, don't highlight groups
Change-Id: I560c6e11d95cf82453d3af68eb194fa876975687
2017-02-28 14:21:19 -05:00
jenkins-bot
17eda64357 Merge "includes: Replace implicit Bugzilla bug numbers with Phab ones" 2017-02-28 00:51:57 +00:00
jenkins-bot
32ed9feb39 Merge "Add class in diff and history links in ChangesList" 2017-02-23 21:31:31 +00:00
Stephane Bisson
09e441003b RCFilters UI: Highlight behavior
Let there be highlight! and there were highlights
And RCFilters separated the highlight from the darkness
And it defined highlights as five colors
The lights are called yellow and green, and the darks red and blue
And there were colors and there were circles; one highlight.

This is the commit that adds highlight support for filters both in the backend
and the UI. The backend tags results based on which filter they fit and the
front end paints those results according to the color chosen by the user.
Highlights can be toggled off and on.

Also added circle indicators to the capsule items and each line of results
to indicate whether the line has more than one color affecting it.

Bug: T149467
Bug: T156164
Change-Id: I341c3f7c224271a18d455b9e5f5457ec43de802d
2017-02-23 10:58:56 -08:00
James D. Forrester
9635dda73a includes: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
2017-02-21 18:13:24 +00:00
Timo Tijhof
2e37dc5b3c rcfeed: Ensure formatter (and other params) is passed to RCFeedEngine
Follows-up 39a6e3dc4d. Class-based feeds are always given their parameters
by RCFeed::factory. However because the old getEngine() method insists
on creating its own object, the constructor parameters were not given.

Add it as optional parameter and pass it through there.

This is backwards-compatible still because before the 39a6e3dc4d refactor,
an RCFeedEngine also was not given information about any formatter and it
was the callers responsibility to format the line before calling send().
CentralAuth still uses it this way and that works fine. The core-caller
that expected the construction parameters since 39a6e3dc4d is hereby fixed.

The test couldn't catch this because it constructed the class instance there,
since PHPUnit does not support a mock class that is instantiated by foreign
code, and the parameter is passed there.

Bug: T156996
Bug: T157106
Change-Id: I83433cf57b6e040cdb69f3ad8807a999c4f931a5
2017-02-04 03:31:44 +00:00
Amir Sarabadani
934a53ea7c Add class in diff and history links in ChangesList
It would make it easier to select in javascript and CSS

Bug: T157178
Change-Id: I2d5ef8c180ae4ff6e7f5d0ab443dc7084f8c4c77
2017-02-04 06:59:39 +03:30
jenkins-bot
5d822c82c2 Merge "Replace use of &$this" 2017-02-01 04:38:53 +00:00
Timo Tijhof
39a6e3dc4d Refactor RCFeed configuration (backwards compatible)
Previously:
* Engines had to be registered in $wgRCEngines.
* The RCFeedEngine classes took no constructor arguments and
  were expected to send whatever text is previously formatted
  without any information about it. This generic design was
  flexible in allowing one to use any formatter with any engine
  with minimal configuration and no need for additional classes.
* Each feed configured their destination by setting a 'uri'
  option that encodes the name of the engine in PHP as the uri
  scheme. Other uri components had to be used for any other
  parameters to the engine (host, port, path). While fairly
  limited, it was sufficient for the default engines in core.

Changes:
* Allow feed classes to be directly associated with a feed in $wgRCFeeds
  via a new 'class' option - without the indirection of 'uri' and
  $wgRCEngines. All options are passed to the given class constructor.
  This matches the design used elsewhere in MediaWiki. (ObjectCache,
  FileRepo, FileBackend, JobQueue, LBFactory, etc.)

  This means we no longer enforce a 1:1 mapping of internet protocols
  to a specific feed engine, and it allows settings to be passed
  without being encoded as a URI neccecarily.

  Main use case for this refactor is EventBus (see I7edc4d57fa),

  Interestingly, this matches the (then incorrect) documentation
  written for $wgRCFeeds in 2961884b43 (which mentions an 'engine'
  property that would do the same thing).

* Move the default 'omit' filters and unrestricted 'formatter' handling
  to a new FormattedRCFeed class, which remains the default.

* Deprecate RecentChange::getEngine() in favour of RCFeed::factory().

* Document wgRCEngines as "@since 1.22". Follows 2961884b43, ffc71cb6af.

Change-Id: I8be497c623c5d928762e3d3406a388f4d91add9a
2017-02-01 04:23:38 +00:00
Brad Jorsch
fb3ae6fbe3 Replace use of &$this
Use of &$this doesn't work in PHP 7.1. For callbacks to methods like
array_map() it's completely unnecessary, while for hooks we still need
to pass a reference and so we need to copy $this into a local variable.

Bug: T153505
Change-Id: I8bbb26e248cd6f213fd0e7460d6d6935a3f9e468
2017-01-31 23:01:54 -05:00
Timo Tijhof
717f4b0dff rcfeed: Add basic PHPUnit integration test
Change-Id: Ifb5ddd4bda6cd1be050da7a5419ebe90f5ecf60f
2017-01-26 00:43:03 +00:00
Zhuyifei1999
c675393413 wfMessage: use Message::params() to handle all the message parameters
The old code was similar to Message::params(), but Message::params()
was unable to handle "special" parameters and received an overhaul
in 7f2663f, yet wfMessage remained broken. To avoid duplication,
wfMessage shall call Message::params() to correctly handle these
parameters.

CategoryMembershipChange::getChangeMessageText and its caller has
been updated so as not to take advantage of this bug.

Bug: T153747
Change-Id: I6667acf7e71c9db07fefc9fbb741c160e15823ff
2016-12-20 19:22:54 +00:00
MGChecker
2ee4c67286 Introduce separate log action for deleting pages on move
Since T106119, moves that overwrite a redirect produce a deletion log
entry. It should be possibleto identify such deletions within other ones.
Note that this patch only applies for actions in the future because there
is no way to easily identify these cases for the software (until now).

Bug: T145991
Change-Id: I3c006bca57351d82031c4fdce0c53f65d630b0d9
2016-11-13 01:27:04 +01:00
jenkins-bot
147274cece Merge "Create ChangeTagsUpdate hook" 2016-09-28 02:25:23 +00:00
cenarium
ee5cafc050 Create ChangeTagsUpdate hook
This creates a hook triggered when updating change tags, so that
extensions can take actions when tags are updated.
When tagging accompanies the action, the recent change is passed
while when tagging is subsequent to the action, the user who
performs the tagging is passed.

Bug: T118698
Change-Id: Ifb0cdc43252c4185e4f216d23b8a21fb31595a37
2016-09-28 02:15:30 +00:00
Kunal Mehta
fc4de49545 Make RecentChange::addTags() accept a string
Most planned callers of RecentChange::addTags() only want to add a
single tag, so forcing them to create an array seems unfriendly. Plus
this lets us avoid a array_merge call.

Change-Id: If001ba9ff01a33be158e7edd5c5e4de9825fa180
2016-09-27 14:50:13 -07:00
jenkins-bot
3649eb7db2 Merge "Avoid multiple writes to changetags table in recentchanges_save hook" 2016-09-27 14:28:22 +00:00
cenarium
33389dd44c Avoid multiple writes to changetags table in recentchanges_save hook
Currently, extensions that add tags within the recentchanges_save
hook directly call ChangeTags::addTags. This often results in
consecutive writes to the changetags table.
This provides a addTags method to RecentChange so extensions
can simply use it when they want a tag added. And all the actual
tagging is done once at the end.

Change-Id: I8df2fd983c12632337e8d2922fa357808482338c
2016-09-27 16:08:31 +02:00
Aaron Schulz
5bbac35ed1 Replace DatabaseBase:: with Database:: and update type hints
Change-Id: I3919b04eb2de4fa0bf8a02239fb5bbf17d347511
2016-09-27 04:20:03 +00:00
jenkins-bot
93845ed2ad Merge "Avoid using cascadingDeletes()/cleanupTriggers()" 2016-09-19 19:31:44 +00:00
Aaron Schulz
e5ee887448 Avoid calling awful DatabaseBase::strictIPs() method
That method should be removed since it encourages incompatibility

Change-Id: Id8a0174266bcd988c85943507f1edb3518fe087e
2016-09-17 19:21:53 -07:00
Aaron Schulz
4c08bf8d96 Avoid using cascadingDeletes()/cleanupTriggers()
Simplify DB callers by just having one code path.
All but some very old code paths bothered with these.

Change-Id: Iaf7a2f83146a0ed15995f9cfc74edcf16ae5a448
2016-09-18 02:05:07 +00:00
Aaron Schulz
a2790b1b80 Remove wfGetCaller() dependency from DatabaseBase
Change-Id: I3e240b2eb5c1f6a21f1bc974c3d28f5755c7451a
2016-09-15 14:40:00 -07:00
Aaron Schulz
047b90e744 Make sure emails from RecentChange::save() are for comitted rows
Change-Id: I9086a70348d2f0843527e3805e9f6aef3356ee03
2016-09-12 14:23:14 -07:00
Aaron Schulz
a448eafb7d Fixup some rc_* fields if empty for STRICT mode in RecentChange
Change-Id: Ie3849f5df8bc4f98d668ed024a052523357d3514
2016-09-06 15:31:34 -07:00
Aaron Schulz
950cf6016c Rename DB_SLAVE constant to DB_REPLICA
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.

The old constant is an alias now.

Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
2016-09-05 22:55:53 -07:00
Aaron Schulz
16266edff3 Change "slave" => "replica DB" in /includes
Change-Id: Icb716219c9335ff8fa447b1733d04b71d9712bf9
2016-09-05 21:01:01 +00: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
umherirrender
b85a7733fa Add comment to ChangesList::showCharacterDifference
Needed styles was moved to module

Follows Ifd90292fc54875403d871429ce6e5020036d4797

Change-Id: I09129b7621ed97272416bb99799381c3e7158261
2016-07-15 14:17:55 +02:00
amir
49b39049dd Make classes actually work in lines in EnhancedChangesList
Change-Id: I2a1dc712d735077dd3741aa0d066933a81c4e568
2016-07-08 09:48:23 +00:00
amir
1a54516530 Let EnhancedChangesListModifyLineData Hook change classes as well
Change-Id: I7c2ae57bd3b18c26b12dd36e331deb6af5fa36c2
2016-06-15 11:39:27 +02:00
Kunal Mehta
53ccc289fa ChangesList: Use LinkRenderer instead of Linker::link()
Change-Id: Iae32a9e365aad268d2671df6a0b916e4d9c0a801
2016-05-26 14:47:45 -07:00
Derk-Jan Hartman
17221b41cb Remove explicit tabindex from diff links
These were added to Special:RecentChanges in 2004, but it doesn't
match what we do in any of the other lists. For accessibility
purposes, in flow indexing is preferred these days, or alternatively
a JS controlled roving tabindex, but this was neither.

Bug: T116127
Change-Id: Id455fafe4bdea40fb5988bdec14eed672844c8e3
2016-05-25 00:46:54 +02:00
aude
4ae160aac7 If $line is empty in EnhancedChangesList, don't try to access parts of array
In getLineData, if the EnhancedChangesListModifyLineData hook returns false,
then $line is an empty array and recentChangesFlagsRaw is not set.

If $line is empty then presumably we don't want to render it and
can skip the line here.

Bug: T133296
Change-Id: I92fded07274a06a0dd2929b97815bfe56f1847ea
2016-05-04 15:57:06 +00:00
jenkins-bot
46202ee2b2 Merge "Hide hiddencat catwatch changes in special changelists" 2016-04-19 07:34:52 +00:00
WMDE-Fisch
b7221eaa08 Hide hiddencat catwatch changes in special changelists
If a hidden category has a member added or removed
this will only be shown to users that have the user
preference "display hidden categories".

Also added method to WikiCategoryPage to check
for hidden status.

Added unit tests for both.

Bug: T127944
Change-Id: Ic53d51391fa29d5e18fef4c42b8a275816c7ba4a
2016-04-18 16:41:26 +02:00
jenkins-bot
4311edad5f Merge "Fix RecentChange::parseParams @return docs" 2016-04-18 12:25:30 +00:00
addshore
e2572a0b2f Fix RecentChange::parseParams @return docs
Per the docs of unserialize:
In case the passed string is not unserializeable, false is returned.

Also as we can not guarentee an array was serialized in
rc_params we cant say it will always be an array...
Quite often this is just an empty string which will
result in: "s:0:"";" (not an array)....

Change-Id: Ib22f9f7468a23ce3d4f145d47f8514d08be6c957
2016-04-18 10:13:10 +00:00
matejsuchanek
82b5a3cdf3 Kill obsolete check
Was a temporary fix for T126428 and was added in
c940fa8ec1.

Change-Id: Iad988f69068147cdc24c8829627875274540b16e
2016-04-17 09:20:49 +00:00
addshore
573e8c1bc5 CatWatch don't show the number of pages transcluded
Providing the perfectly correct number of pages
that have acctually been added to or removed from a
category is extermly hard.

Rather than providing data that is most likely wrong
and a bit useless ONLY provide a link to Special:WhatLinksHere.

This touches on the following bugs and may mean that
some of them don't need to be thought about any further.

Bug: T126855
Bug: T126407
Bug: T126139
Change-Id: Ida06d822d1955091595c17c9c6c2968a40a93bcd
2016-04-14 09:22:49 +01:00
jenkins-bot
6a4214dc89 Merge "Allow to pass a rev id to a log entry without making it unpatrolled" 2016-04-07 08:47:03 +00:00
jenkins-bot
54277fb7d5 Merge "Generalize recentChangesFlags rollup" 2016-04-02 16:21:12 +00:00
amir
78f109bfdd Generalize recentChangesFlags rollup
Flags can be either 'any' or 'all' type, and both core and extension flags will be
rolled up into the top-level line of grouped changes.

See Ic49a355a2

Bug: T120921
Bug: T112856
Change-Id: If9fd6af3ac7ac2fbee9aa5536fe94d7574699966
2016-04-02 18:02:20 +04:30
Aaron Schulz
ba3424b437 Whitespace cleanups
Change-Id: I43646a60b8a5b6d5b7813b013fd0f1719d00484c
2016-03-25 10:37:57 -07:00
WMDE-Fisch
b536c129cf Adding number of changes info for grouped category changes
This patch addes the summarized number of category changes
for grouped category changes on the EnhancedChangesList.

Bug: T126849
Change-Id: I3c8ccb2ad6310dac19a724b2ce923c1e67e588be
2016-03-15 21:19:17 +00:00
jenkins-bot
c340c41b37 Merge "Make unused variable optional in ChangesList::insertDiffHist" 2016-03-15 14:52:56 +00:00
cenarium
d7a37e8daa Allow to pass a rev id to a log entry without making it unpatrolled
This adds new methods to ManualLogEntry that allow to specify that
a log entry is patrollable. RecentChange::newLogEntry then checks
this in order to allow or not unpatrolled status instead of checking
if there is an associated rev id. This allows to associate a revision
to a log entry without possibly making the recent change unpatrolled,
and extensions can implement patrol of actions not dependent on an
associated revision id.

Bug: T127848
Change-Id: I98298047142819b69639e6ca9d77c5ba982a380c
2016-03-14 16:11:05 +01:00
Timo Tijhof
ce64d57298 ChangesList: Add support for context source in ChangesList::flag()
This way the messages are generated in the correct language instead
of relying on the user language from global context.

This should ideally become a non-static method at some point,
but currently there currently many out-of-class callers.

Change-Id: Ifb1756c1a3bddc717387ed66a58dedd4c1a7dab9
2016-03-08 17:17:20 +00:00
Timo Tijhof
cc58e4cd6f ChangesList: Use context language for LogPage::getName() message
Was calling escaped() directly on a Message object which resulted
in a $wgLang lookup, thus ignoring the context language given to the
class constructor.

Change-Id: Ia8ce739178924299ca559088fc40a2b048d7ed72
2016-03-08 17:11:58 +00:00
jenkins-bot
996b7350f3 Merge "Add tags support to patrol, protect, unblock, and undelete" 2016-03-03 16:28:45 +00:00
Geoffrey Mon
e70c4eb664 Add tags support to patrol, protect, unblock, and undelete
- Add 'tags' parameters to appropriate API modules
- Add tag-adding logic to appropriate functions that carry out
  relevant functions
- ManualLogEntry::{set,get}Tags to handle adding tags to log
  entries in a cleaner fashion
- Use ManualLogEntry::setTags in LocalFile::recordUpload2

Bug: T97720
Change-Id: I98c52da7985623bfdafda2dc2dae937b39b72419
2016-02-29 16:59:31 -05:00
jenkins-bot
207a47a1fe Merge "Add mw-changeslist-(log|ns)-* class to OldChangesList as well" 2016-02-29 08:25:50 +00:00
jenkins-bot
41a15e0df3 Merge "CatMembChange use timestamp from revision where possible" 2016-02-21 06:31:18 +00:00
jenkins-bot
a85d1b9d0c Merge "rc_old/new_len null for CategoryMembership RC change" 2016-02-18 23:45:50 +00:00
Glaisher
d3e12637d6 Add mw-changeslist-(log|ns)-* class to OldChangesList as well
Bug: T111666
Change-Id: I880c86f318710f179e60ed42c65081514757c6a0
2016-02-18 22:33:53 +05:00
addshore
c940fa8ec1 rc_old/new_len null for CategoryMembership RC change
This will mean that EnhancedChangesList does not
do odd things.
Log changes also have this set to null

This also adds a tiny bit of cleanup for the past which
could be removed in a month or 2.
This will fix all current RC entries as well as new ones.
Once no old RC entires for CategoryMembership changes exist
we can kill the type check.

Bug: T126428
Change-Id: Ib19819373af70e10b0c750ffdb06156764b7fa3d
2016-02-18 16:09:30 +00:00
addshore
69566788e0 CatMembChange use timestamp from revision where possible
This should mean that where possible the timestamp for
the category membership change will be equal to that of
the time of the revision that caused the change.

The IDs still may have space between them.

Bug: T126048
Change-Id: Ia270451ccb02f2fca979ccb1fcefa5bdb4a96722
2016-02-18 10:55:59 +00:00
WMDE-Fisch
f1b7375ef0 Changed linking of articles to Linker::link in ChangeList
When non-existent categories appear in the changelist
they wont get marked reddue to the use of
Linker::linkKnown.

Bug: T126854
Change-Id: I3dc9746c0fe55e81ffd2df1c04ade6950efcc020
2016-02-17 23:54:27 +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
jenkins-bot
592637225a Merge "Add IContextSource as parameter to ChangeTags::formatSummaryRow" 2016-02-12 22:39:02 +00:00
jenkins-bot
df85890b76 Merge "Make change tagging of edits in RecentChange::notifyNew/Edit" 2016-02-12 02:46:31 +00:00
aude
d188ec34bb Make unused variable optional in ChangesList::insertDiffHist
$unpatrolled is unused in the method, so make it optional,
and then uses of it can be removed.

I realize it would do no harm to remove it completely, even
if a few (2 that I know of) extensions still pass the variable
to the method, but think this is nicer way.

Change-Id: Idbe6f00e9eb40db6a28de76fca0aea7c17b75656
2016-02-11 15:46:40 +01:00
Ricordisamoa
02a32c1c7a Stop doing $that = $this in includes/changes
Closures support $this as of PHP 5.4

Change-Id: I6bf728bf5c2222fd43945ec7a60a5f29efd42f0c
2016-02-11 00:25:29 +01:00
cenarium
b009e0af21 Make change tagging of edits in RecentChange::notifyNew/Edit
Change tags to apply to an edit can now be passed directly to the
WikiPage::doEditContent function. They are then passed to the
RecentChange::notifyNew/Edit functions where tagging is made
after the recent change is saved. This ensures that other callers
of doEditContent will not run into the same issue as T100248.
ApiRollback is fixed in this way.
In addition, we'll have to pass tags in this way for core tagging
of edits (I2e48bd458fc8d7c289f04dc276f9287516e0b987), and this makes
it possible to merge the arrays of tags and call ChangeTags::addTags
only once.

Change-Id: I829960c7a33b70464065839d7504d7529dfd0b72
2016-02-10 13:03:30 +01:00
Aashaka Shah
124026a712 Add IContextSource as parameter to ChangeTags::formatSummaryRow
Using IContextSource avoids the use of $wgLang and wfMessage which make
use of global $wgTtle.

Add IContextSource as parameter to ChangeTags::formatSummaryRow to avoid
globals. Define an IContextSource instance in all functions which
reference ChangeTags::formatSummaryRow and pass it in ChangeTags::formatSummaryRow
function call.

Also make the default value of IContextSource $context as null in
parameter, to avoid breaking changes for old callers in extensions.

Document default null value of IContextSource and add a @note to prefer
IContextSource over null value.

Remove trailing whitespace, and make code order according to parameter
order.

Bug: T105648
Change-Id: Ib54a6a96b73f6cd8fcdf8e520db2448a1e811cfa
2016-02-04 23:32:24 +05:30
addshore
044f6418b1 Switch name to username in @author tags
From now on I will simply use addshore
everywhere to keep things uniform...

Change-Id: Iaf441b2d7a67a12c20529f0e9c7b47819f4abfae
2016-01-27 10:59:31 +01:00
jenkins-bot
6505e5f278 Merge "Allow patrol of uploads" 2016-01-07 01:06:02 +00:00
cenarium
c53f647658 Allow patrol of uploads
This allows to patrol file uploads, both new files and new file
versions, from the description page, provided $wgUseFilePatrol
is set to true. Special:NewFiles can be filtered to hide patrolled
files.

Bug: T11501
Change-Id: If71af58719a4461f12d125455b7bef07164525ca
2016-01-06 14:57:22 -08:00
jenkins-bot
bee82be112 Merge "Option to associate a rev id to a RC log entry, allowing unpatrolled status" 2016-01-06 22:04:10 +00:00
aude
e4506630eb Remove unused, deprecated ChangesList::usePatrol
Deprecated since 1.22 and not used in any extension
hosted in Wikimedia git (and afaik elsewhere).

Change-Id: I0974ba80b7ab21b056d7f16e936b5c564b562e6d
2016-01-03 11:09:19 -08:00
Adam Roses Wight
de8f8c8248 Use template to render EnhancedChangesList groups
Rewrite a chunky HTML string concatenation party as Mustache template
rendering.  This decouples the view from the controller.

Bug: T120921
Change-Id: I3217b80168f89e7b91dbc33a7053865ad3408615
2015-12-28 20:09:11 +00:00
umherirrender
54c1e18eec Remove various double empty newlines
The double empty newline is not needed between functions, variable or at
end of file

Change-Id: Ib866a95084c4601ac150a2b402cfa184ebc18afa
2015-12-27 18:55:12 +00:00
cenarium
0160b410bd Option to associate a rev id to a RC log entry, allowing unpatrolled status
This provides a mechanism to associate a revision id to an action.
For example in core, it makes sense for moves and uploads, which both
generate null revisions (also protections, but it isn't interesting if one
has patrolling in mind).

Crucially, in that case an unpatrolled status is allowed for the RC item.
So if the performer of the action is not autopatrolled, it will be displayed
as unpatrolled, and if the performer is autopatrolled, it will record an
autopatrol action.

When one associates a rev id to a type of action, one should also implement
a mechanism to patrol said action, since getting the diff for the associated
revision is not user friendly and works only if RC patrol is enabled.
This is done for uploads in If71af58719a4461f12d125455b7bef07164525ca (with
a new file patrol) and for moves in Ie0fa417feaf930c096b69521fc54d57aecd6cd51
(within RC patrol).

Extensions might possess other such actions that could benefit from patrolling.

Bug: T122089
Change-Id: I694424eca32b69e277f89d4c15183870983d0993
2015-12-21 22:14:00 +00:00
Adam Roses Wight
23f436ee77 Clean up recentChangesFlags rollups
Move ad-hoc variables under an array, in preparation for merging with
RC flags implemented by extensions.

Bug: T120921
Change-Id: I5dd91ba5e5ed36785d9fbf01673defcd227c8b01
2015-12-09 09:53:33 +00:00
Aaron Schulz
6dedffc2d7 Move category membership RC updates to CategoryMembershipChangeJob
* Recursive link updates no longer mention an category changes.
  It's hard to avoid either duplicate mentioning of changes or
  confusing explicit and automatic category changes.
* LinksUpdate no longer handles this logic, but rather WikiPage
  decides to spawn this update when needed in doEditUpdates().
* Fix race conditions with calculating category deltas. Do not
  rely on the link tables for the read used to determine these
  writes, as they may be out-of-date due to slave lag. Using the
  master would still not be good enough since that would assume
  FIFO and serialized job execution, which is not garaunteed.
  Use the parser output of the relevant revisions to determine
  the RC rows. If 3 users quickly edit a page's categories, the
  old way could misattribute who actually changed what.
* Make sure RC rows are inserted in an order that matches that
  of the corresponding revisions.
* Better avoid mentioning time-based (parser functions) category
  changes so they don't get attributed to the next editor.
* Also wait for slaves between RC row insertions if there where
  many category changes (it theory it could well over 10K rows).
* Using a separate job better separates concerns as LinksUpdate
  should not have to care about recent changes updates.
* Added more docs to $wgRCWatchCategoryMembership.

Bug: T95501
Change-Id: I5863e7d7483a4fd1fa633597af66a0088ace4c68
2015-12-03 11:28:05 +00:00
Aaron Schulz
3517be1cf0 Migrate feeds from $messageMemc to the WAN cache
This makes the delete() calls work properly for all DCs.
Also, using the message cache was fairly bizzare.

Change-Id: Idec7fa47811e982ba89bb8fbbd9565a26585e77f
2015-11-10 11:11:05 -08:00
addshore
6a65ce223f Add triggeringRevisionId to LinksUpdate JobSpec
Bug: T117860
Change-Id: I8c730a434b8bdda7664fd1e3bb3fbc8840804950
2015-11-05 12:07:01 +00:00
Timo Tijhof
230e94533a Convert ChangesList from MapCacheLRU to HashBagOStuff
Also make use of getWithSetCallback() while at it.

Change-Id: I6bd29db7c6564fcaf4489ec0f226ac83bafc75e8
2015-11-04 01:44:47 +00:00
Kunal Mehta
56a9ae8d28 Fix diff/history links not showing up for ungrouped enhanced RC
Looks like a typo or accident from d40cd42b9f.

Bug: T116899
Change-Id: I33b65afa78480612b9312282922686a64346fef2
2015-10-28 13:48:46 -07:00
jenkins-bot
682e2b9c6b Merge "Enable users to watch category membership changes #2" 2015-10-20 21:41:16 +00:00
addshore
d40cd42b9f Enable users to watch category membership changes #2
This is part of a chain that reverts:
e412ff5ecc.

NOTE:
- The feature is disabled by default
- User settings default to hiding changes
- T109707 Touching a file on wikisource adds and
      removes it from a category... Even when page
      has no changes.... WTF? See linked issue,
      marked as stalled with a possible way forward
      for this patch.
      @see https://gerrit.wikimedia.org/r/#/c/235467/

Changes since version 1:
- T109604 - Page names in comment are no longer
      url encoded / have _'s
- T109638 & T110338 - Reserved username now used
      when we can't determine a username for the change
      (we could perhaps set the user and id to be blank
      in the RC table, but who knows what this might do)
- T109688 - History links are now disabled in RC....
      (could be fine for the introduction and worked
      on more in the future)
- Categorization changes are now always patrolled
- Touching on T109672 in this change emails will never
      be sent regarding categorization changes. (this
      can of course be changed in a followup)
- Added $wgRCWatchCategoryMembership defaulting to true
      for enabling / disabling the feature
- T109700 - for cases when no revision was retrieved
      for a category change set the bot flag to true.
      This means all changes caused by parser functions
      & Lua will be marked as bot, as will changes that
      cant find their revision due to slave lag..

Bug: T9148
Bug: T109604
Bug: T109638
Bug: T109688
Bug: T109700
Bug: T110338
Bug: T110340
Change-Id: I51c2c1254de862f24a26ef9dbbf027c6c83e9063
2015-10-20 14:23:48 -07:00
Adam Roses Wight
25c586363b Make attributes explicit
Two attributes were referenced, but not declared.

Change-Id: Icb3ce046c15c5709e2f3738ba03e44beaaafd46b
2015-10-19 02:35:28 -07:00
jenkins-bot
0b635582a3 Merge "Add recentChangesLine to ChangesList" 2015-10-14 12:30:11 +00:00
addshore
304a56f7d8 Add recentChangesLine to ChangesList
This method is implemented in all sub classes.

Not having this method here looks odd as
ChangesList::newFromContext returns a ChangesList
and parts of the code base then call recentChangesLine
on that object which may not exist..

In the future we might even have some interface here?

Change-Id: Iad00a956862c078a2bcaf3ef0602abcf3fedb7d2
2015-10-13 20:19:16 +01:00
jenkins-bot
b3a3a97adc Merge "Added autopatrol parameter to MarkPatrolled and MarkPatrolledComplete hooks" 2015-10-13 13:04:02 +00:00
Lojjik Braughler
4e6b945b95 Added autopatrol parameter to MarkPatrolled and MarkPatrolledComplete hooks
Change-Id: Ibc832ba8cec8eaef673ef07534c5522f678e8f58
2015-10-12 16:13:36 -04:00
Kevin Israel
b52502eec5 Change 1.26 to 1.27, mostly in doc comments
Using the following command line, I have found doc comments (and
a wfDeprecated() call) mentioning "1.26" when they should mention
"1.27" instead, which I have fixed manually:

git diff -M REL1_26 | grep --color=always -C 10 -iP \
'^\+.*\D1\.26(\D|$)' | aha > oldver.html

Follows-up these commits:
* 047b60b96d
* 169b7b98b5
* 25a44aa3e4
* 2fb2a3f14b
* 3f1e9fa268 [1]
* 8c84af70b6
* c0cb80beac
* d04a92a551
* d3b85592ea

[1] Release notes moved in I195dd1cf.

Because a release note stating that the UserRights hook is deprecated
was added in 37062a0c0d (before the branch cut), this commit does not
change the Hooks::run call that had been changed in 21206c8fbe.

Change-Id: I5a427f003e7e3b4559fe377bcdfdca466a570708
2015-10-07 01:41:41 -04:00
addshore
a1094b42db Retry getting CatChange RC from master
This adds optional flags to Revision::getRecentChange
And uses them in CategoryMembershipChange

Bug: T109700
Change-Id: I197ebccf1f62cdcb03ce4daa2527b973e495236c
2015-09-30 23:09:12 +01:00
jenkins-bot
2cb893c085 Merge "Introduce CategoryMembershipChange" 2015-09-30 12:44:37 +00:00
addshore
2fb2a3f14b Introduce CategoryMembershipChange
This is split from:
I03516bb34144d95e5f25c46ae98ab70ce699b31b

Change-Id: I27539d25ef3e81cf991657dffc0a62b9719d21d8
2015-09-29 23:59:34 +01:00
Aaron Schulz
39ad19a671 Removed $options from RecentChange::newFromConds
* The FORCE INDEX statements are not needed

Change-Id: Ia6f386140e88ad01fc35a10b00dbcb0d1eb934ea
2015-09-29 10:31:55 -07:00
Vivek Ghaisas
c54766586a Fix issues identified by SpaceBeforeSingleLineComment sniff
Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
2015-09-26 23:06:52 +00:00
Matthias Mullie
c9fedd8fc0 Don't attempt to render block if none of the lines can be shown
Not only doesn't it make sense to render this, getLogText has
some assumptions about this array, and an empty array just didn't
work.

Bug: T112738
Change-Id: Ibdc0c4ed15449883a91a3292bfa174ff84116be0
2015-09-23 13:28:03 +02:00
addshore
b611d49ac5 Refactor changeTypes in RecentChange
This is split from:
I03516bb34144d95e5f25c46ae98ab70ce699b31b

Change-Id: I285cdbe3d1a62aa1071a5c174928136c3f59d557
2015-09-21 16:08:52 +01:00
jenkins-bot
ac17fbac94 Merge "When aborting EnhancedRC block line, block should reflect that" 2015-09-16 11:00:33 +00:00
Matthias Mullie
e39bd385b2 When aborting EnhancedRC block line, block should reflect that
It was possible to abort the rendering of all block lines, but
the block would still be rendered (with nothing inside). It
would also render a "x changes" link, even though that "x" is
no longer correct.

This had been reverted in adba11dfe3,
but has now been fixed up.

Change-Id: Ic5d15e56bc2f46fa6aa8c9375f3cafeb13e1ea9c
2015-09-16 12:46:44 +02:00
jenkins-bot
266dbe55e8 Merge "Revert "When aborting EnhancedRC block line, block should reflect that"" 2015-09-16 10:12:02 +00:00
Catrope
adba11dfe3 Revert "When aborting EnhancedRC block line, block should reflect that"
Caused errors when there were two new topics created on the
same Flow board on the same day.

BadMethodCallException from line 496 of
/srv/mediawiki/php-1.26wmf23/includes/changes/EnhancedChangesList.php:
Call to a member function getTitle() on a non-object (NULL)
{"exception_id":"58b04b8c"}

This reverts commit b30417048b.

Bug: T112738
Change-Id: Ib404d78eaf1aa9ac7ea34516183bcc9956efc515
2015-09-16 09:56:57 +00:00
jenkins-bot
7b0df4e549 Merge "When aborting EnhancedRC block line, block should reflect that" 2015-09-10 00:21:44 +00:00
CSteipp
e412ff5ecc Revert "Enable users to watch category membership changes"
This reverts commit f6879ea16e.

Bug: T109638
Change-Id: I770d8d33a4cff3829bdea9a4df24de209cbe691b
2015-08-20 10:35:56 -07:00
jenkins-bot
8a1152b913 Merge "RC: Handle getLine returning null, which breaks Redis engine (at least HHVM)" 2015-08-19 03:24:44 +00:00
Matthew Flaschen
047fc253d0 RC: Handle getLine returning null, which breaks Redis engine (at least HHVM)
Bug: T109544
Change-Id: I02dcfc7a10a74571232a898f1ef348f8dbc48b45
2015-08-18 23:08:36 -04:00
Kai_WMDE
f6879ea16e Enable users to watch category membership changes
Bug: T9148
Change-Id: I5a89d8f19804b1120f4c755d834e2da6ca12ceae
2015-08-13 17:58:06 +02:00
Kunal Mehta
a220d8b830 Unbreak missing flags in enhanced RC
$this->recentChangesFlags() was being called on the data twice, so the
second time it was processing the string, causing the flags go missing.

Follows-up 94f153db6a.

Bug: T105237
Change-Id: I04465d0317eecc1c12e47bc9a74f11986eba99a4
2015-07-08 14:57:20 -07:00
Matthias Mullie
b30417048b When aborting EnhancedRC block line, block should reflect that
It was possible to abort the rendering of all block lines, but
the block would still be rendered (with nothing inside). It
would also render a "x changes" link, even though that "x" is
no longer correct.

Change-Id: I94ae68e80461dcfbf328683522ea6cb58c6c5753
2015-07-08 17:11:55 +02:00
Matthias Mullie
dc3ddcc4a2 Allow hooks to abort lines in EnhancedRC
Bug: T104564
Change-Id: I4a2f97d83f38071984d571773a6b09b6b6643d6d
2015-07-03 10:18:58 +02:00
Matthias Mullie
94f153db6a Add hook EnhancedChangesListModifyBlockLineData
Introduce a new hook to allow (single) block-level entries.
Very similar to EnhancedChangesListModifyLineData.

Bug: T104399
Change-Id: I6b4715277d44e5f09d7a230b33e956676aeab1c2
2015-07-03 10:16:52 +02:00
Stephane Bisson
28f2fe8a22 Add 'EnhancedChangesListModifyLineData' hook
Gives extensions a chance to modify the data used to
build each enhanced recent change 'inner' lines
(as opposed to the header lines).

Bug: T102021
Change-Id: Ia8a796fb9621db14d6574e66a4572e1fdf3bad03
2015-06-26 12:51:55 -07:00
umherirrender
70f3afd548 Remove unneeded empty lines at begin of if/else/foreach body
An if body must not begin with an empty line

Change-Id: I62b058be337fcc85a120fcd3dadce564db59a271
2015-06-19 20:05:45 +02:00
jenkins-bot
9c092814c7 Merge "Omit 'external' changes from ChangesFeed" 2015-06-13 01:18:56 +00:00
Kunal Mehta
f6e5079a69 Use mediawiki/at-ease library for suppressing warnings
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.

Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.

Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.

Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
2015-06-11 18:49:29 +00:00
Stephane Bisson
62961558a5 Encapsulate rc_params handling in RecentChange::parseParams
* Make MachineReadableRCFeedFormatter use it

* Some unit tests

* Also fixed some line-too-long warnings in RecentChange.php

Change-Id: I443d14f5d4cdac0945cb9c03608d55745bbb865b
2015-06-10 15:11:37 -04:00
addshore
f5e08902a7 Fix some RecentChange phpdoc return types
Change-Id: I3e75a97f7fc76e2dc052463511e32f330cfca9ce
2015-06-01 12:07:17 +01:00
Aaron Schulz
97b2a1dfda Made RecentChange defer the save() method via DeferredUpdates
* Also made it handle calling PatrolLog::record() itself

Bug: T100042
Change-Id: I58ef060e02b89a5f9dadc0dbc4edba667932beda
2015-05-22 21:00:29 +01:00
Aaron Schulz
072e3666d3 Defer some updates in doEditUpdates()
* These updates add to editing time and can be done
  after sending the HTTP response for performance
* Also improved the active users job insertion logic

Change-Id: I5b25217c4f08db7fa9a05eac046283f02d45865e
2015-05-21 19:38:25 +00:00
Matthias Mullie
fd64488787 Add hook EnhancedChangesList::getLogText
Enhanced RC generates these "(3 changes | history)" links for
every block of grouped recentchanges. That changes-link links
to a diff page.

For Flow, that is all wrong: we have different ids (not integers),
on a different page (&curid=&oldid=&diff= means nothing). Even
the concept of a "diff" page seems wrong here for us - a new post
is not part of some document that can be diffed.
In short: we'll want to generate a different link, and we'll need
a hook to let us change them.

Meanwhile also split the code that generates those links into a
separate method.

Bug: T72513
Change-Id: Ib32fb9552b80f9581d89b3b47da6e5d32e3d84a3
2015-03-03 01:50:32 +00:00
aude
9b11ff7a42 Omit 'external' changes from ChangesFeed
The current formatting does not display these
external changes very well (e.g. doesn't distinguish
between local and foreign wiki user or whatnot).

Unless there is better handling or integration of these,
also with the option of hiding or showing, it is best
to simply exclude these from the feed.

This brings the ChangesFeed inline with default
behavior of Special:RecentChanges and Watchlist.

Bug: T88254
Change-Id: I956a3c392e9f163478b9f6994bde4c0be8932163
2015-02-02 20:32:07 +00:00
Aaron Schulz
99e6b43ab8 Moved RecentChange::purgeExpiredChanges to a job
* Also added a selectFieldValues helper method to the DB classes
  since this use case keeps coming up.

Change-Id: I62cdbb497dc2c8fe4758e756d13688b85165e869
2015-01-16 17:39:31 -08:00
Niklas Laxström
80ca508ed1 Add User::equals
Seems stupid omission. Title has one. Why do I need to think how
to determine how to users objects point to the same user. Allows
more expressive code.

Also fixes a bug in multiple places where users "0" and "00" were
considered equal.

Change-Id: I682392e564b332b77ab489f2ad394fa2d28098a5
2015-01-13 15:04:45 +01:00
Ricordisamoa
2ae155da52 Fix phpcs errors in includes/
Mostly Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines

Change-Id: I678b2f0902f11cd1dfa1611b9da24e7237df9122
2015-01-08 20:15:07 +01:00
Chad Horohoe
aa21e125a3 Remove obvious function-level profiling
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.

Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.

Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
2015-01-07 11:14:24 -08:00
Reedy
4d9143c7f5 Add lots of @throws
Change-Id: I09d0c13070f966fcf23d2638d8fc1328279a5995
2014-12-24 13:49:20 +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
umherirrender
c0151eec5f Fix case of various newFromID/newFromId functions
User::newFromID -> User::newFromId
Revision::newFromID -> Revision::newFromId
RecentChange::newFromID -> RecentChange::newFromId

WikiPage::newFromId -> WikiPage::newFromID
Title::newFromId -> Title::newFromID

Change-Id: I310f26653613951e9b21ce915a92d205a87937f1
2014-12-10 19:40:27 +00:00
Ricordisamoa
f86a5590aa Always use 'bool' instead of 'boolean' after '@param' and '@return'
The former is by far the most common.

Skipped:
* resources/lib/jquery.ui/jquery.ui.datepicker.js
* resources/src/mediawiki.special/mediawiki.special.upload.js

Change-Id: I73c93797e745128ba703e4865080c36784caa474
2014-12-10 11:57:31 +00:00
Chad Horohoe
6c30fff0ba Swap and for &&
Change-Id: I7821a62586cc2d2f929fb3d7d5046958a70efbd0
2014-10-23 13:03:14 -07:00
aude
9ec6c4967e Fix undefined argument in OldChangesList
Bug: 70407
Change-Id: I17bbaeaf7c9cae51e33c859867ef3a3199b68a43
2014-09-09 16:05:53 +02:00
jenkins-bot
00f9ce1105 Merge "Bound the cache size of numberofWatchingusers()" 2014-09-04 20:03:11 +00:00
Aaron Schulz
220d30f8f4 Bound the cache size of numberofWatchingusers()
Change-Id: I60c9898318e340ee3c97d24b528d85a5f8c492e5
2014-09-04 12:49:43 -07:00
jenkins-bot
af9c5d49fd Merge "Move actual OldChangesList line formatting to separate method" 2014-09-01 09:50:19 +00:00
aude
9ec0095e3d Move actual OldChangesList line formatting to separate method
Change-Id: I31100c79abc30460bd08eb50862b51a56b807fba
2014-08-28 13:36:26 +02:00
umherirrender
7c6a25856c Add missing @return to function docs
Change-Id: I45b9d02f94ecc58372268ec5e6a0b572a0b7e2a9
2014-08-23 23:14:57 +02:00
umherirrender
26e71dd640 Use getConfig for ChangesList
Change-Id: I1f440a2fca2dd8f1973987d635c70954938b6ea6
2014-08-22 22:01:08 +02:00
Bartosz Dziewoński
07aef8f753 Remove EnhancedChangesList::arrow() and friends
Not used in core, the only usage outside removed in Ieb5bb6f9.

Also removed two now-unused files from skins/common/.

Bug: 69675
Change-Id: Ia0e9fc2af25af903db085f2a05c04dcd9aff213e
2014-08-18 00:08:48 +02:00
jenkins-bot
ab972997ee Merge "Remove various functions and globals deprecated since 1.22 from RecentChange" 2014-08-14 18:06:35 +00:00
umherirrender
21e0c1c533 Correct variable names in @param to match method declarations
Some @param have a typo in the variable name,
some @param's were in wrong order.

Change-Id: Ie25806831027112b398f6f4a909c59147ac3a5fa
2014-08-13 21:48:28 +02:00
withoutaname
557b2cf3ef Remove various functions and globals deprecated since 1.22 from RecentChange
Change-Id: I5200892e75ffa894133e2e386d53c09536547de9
2014-08-12 22:19:36 -07:00
Tom Arrow
510da8d776 Remove unreachable return in ChangesList.php
Change-Id: Ic00d7b4eaebdaa795b550c4213c518b1c56bd297
2014-08-09 12:25:33 +00:00
umherirrender
02dc9da399 Cleanup some docs (includes/[a-d])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: I7b65fe04db431342cc58b469dc48f41a50c4e891
2014-07-24 19:42:45 +02:00
umherirrender
4ee680a8b3 Fixed spacing
- Removed spaces after not operator (!)
- Removed spaces inside array index
- use tab as indent instead of spaces
- Add newline at end of file
- Removed spaces after casts

Change-Id: I9ba17c4385fcb43d38998d45f89cf42952bc791b
2014-07-24 11:53:04 +02:00
withoutaname
2be66e38e2 Move ChangesFeed to includes/changes/ folder
Change-Id: I4ec541e8fe4234970972904592af2e11375e974d
2014-07-15 17:30:46 -07:00
JuneHyeon Bae
17ebbe492c Remove obsolete RC_MOVE and RC_MOVE_OVER_REDIRECT rc types
RC_MOVE and RC_MOVE_OVER_REDIRECT are obsolete, since at least 2006.
So it is considered safe to remove.

Bug: 63755
Change-Id: I0f17c4d164585a48fb9f0d40b90a7d3b975c7ab8
2014-06-11 02:44:48 +00:00
Timo Tijhof
c0b0a12eab RCFeed: Use named types instead of exposing internal MW constant
Like we do in ApiQueryRecentChanges as well, expose the named
rc.type property, not the internal integer constants.

Change-Id: I89a948eee999032bb2e42cc23345affa879afb42
2014-06-04 04:55:02 +00:00
Kunal Mehta
8e980dfbf5 Allow more flexibility in RC feeds
The user can now specify which feeds to send to in
RecentChange::notifyFeeds if they don't want to use
$wgRCFeeds.

Additionally, the 'formatter' in $wgRCFeeds can now be an object
rather than just a class name.

Change-Id: Ibfdffc17a934e35223887c123331795563102752
2014-05-26 19:27:54 -07:00
aude
e0536cae6f Add method to determine EnhancedChangesList cache grouping key
Change-Id: Iaf3734baa53b71affca77d5243a579cc70bb522b
2014-05-21 13:28:13 +00:00
kishanio
b7cc86cdc0 Move ApiQueryRecentChanges::parseRCType to static method on RecentChange
Prior parseRCType was an private method in includes/api/ApiQueryRecentChanges and also
duplicated in includes/api/ApiQueryWatchList. This method has been made static and moved
to includes/changes/RecentChange.php.

Bug: 65071
Change-Id: Ic911fbcf9411c782685c4f956f8522051f2517f0
2014-05-17 15:07:01 +00:00
Nemo bis
ccd7758c1e Extend AbortEmailNotification hook to access log type etc.
Bug: 42458
Change-Id: Ifc3935f031c49f9b49ae76c5a8af8334e70ca2b1
2014-05-11 09:39:14 +00:00
withoutaname
866f478dc9 Append redirect=no to RecentChanges/Watchlist redirect entries
This change adds redirect=no in the URL of redirect entries in the RecentChanges or in the Watchlist.
Entries which are not redirects will not be affected.
Some typos in documentation were also fixed.

Bug: 890
Change-Id: I79593811d92b2f57abd742c8ba9e66769d8bc9b7
2014-04-28 18:11:13 -07:00
Bartosz Dziewoński
59002d8935 Consistently use '@deprecated since <version>'
Variants included 'in <version>', 'as of <version>' and just the
version number.

Some @deprecated annotations do not have the version number at all,
I want to hunt them down separately.

Change-Id: I8208c6097098f4735d4f51bc42254675f1f27f6d
2014-04-15 22:18:19 +02:00
umherirrender
9c614ac02d Fixed some @params documentation
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.

Change-Id: I8c9f30128b46086064326708a4878228ba459447
2014-04-14 19:52:18 +00:00
aude
7c4278f3f1 Split part of EnhancedChangesList::recentChangesLine into new method
Change-Id: I57f22ac0969fe3ba324a2b9d107c6f2d9968769c
2014-04-08 11:57:01 +00:00
Tyler Anthony Romeo
4211404e02 Added more filter options to $wgRCFeeds
Changed RecentChange::notifyRCFeeds() to allow more
filter options than just omit_bots. In order to mirror
the on-wiki Special:RecentChanges UI, the options
omit_anon, omit_user, omit_minor, omit_patrolled were added,
which omits anonymous, registered, minor, and patrolled
edits, respectively.

Bug: 60941
Change-Id: I716c741f1f7d42b6506a97e9a5733beac23ac16c
2014-04-07 23:36:36 +00:00
Erik Bernhardson
36a664643b New Hook rc/watchlist hook ChangesListInitRows
An extension hooking into recent changes may need to load additional
data that did not fit into the recentchanges table.  This hook gives
extensions an opportunity to see the full result prior to rendering
and batch load where approprite rather than loading piecemeal during
the render process.

This is implemented as an optional method called by the ChangesList
consumer, since the ChangesList never sees the full result set. Hook
implementers must be able to work regardless of the hook being called,
they just have the oportunity to be more efficient when it is called.

Change-Id: If74ae600ffba949364dd381dd3d466cbbaa27286
2014-04-01 09:38:16 -07:00
Siebrand
34c239655e Revert "New Hook rc/watchlist hook ChangesListBegin"
This reverts commit 01798c3813.

The patch set changed a RecentChanges interface used in at least the
extension CleanChanges so that it was generating a lot of warnings.
Additional parameters to existing methods that are used elsewhere
should have defaults to not break backward compatibility.

Change-Id: I1851e23e186ba7aaeb001ba212e56888657a3ae0
2014-03-26 14:08:40 +00:00
Erik Bernhardson
01798c3813 New Hook rc/watchlist hook ChangesListBegin
An extension hooking into recent changes may need to load additional
data that did not fit into the recentchanges table.  This hook gives
revisions an opportunity to see the full result prior to rendering
and batch load where approprite rather than loading piecemeal during
the render process.

Change-Id: I28d4e41437e485e518f2a23b6da00cdc430a8c23
2014-03-24 18:33:15 -07:00
jenkins-bot
9089232169 Merge "Method to identify if a ChangesList is watchlist or normal" 2014-03-18 13:08:59 +00:00
umherirrender
194e54b116 Fix variable name of param doc in RCCacheEntryFactory
Change-Id: I8039ab9ea117ba351061da71a92409e320d8eb84
2014-03-15 13:13:05 +00:00
Erik Bernhardson
1b8db29ed5 Method to identify if a ChangesList is watchlist or normal
There are differences, like grouping, between watchlist and
normal rendering that hook recipients need to know about.
This exposes if the setWatchlistDivs method has been called
which currently happens immediatly after instantiation in
SpecialWatchlist

Change-Id: Ibc06c6d9b878cad3f5da92cfbe3f650ad3f63efa
2014-03-13 10:35:56 -07:00
jenkins-bot
102076134f Merge "Add RCCacheEntryBuilder, split from EnhancedChangesList and cleaned up" 2014-03-12 16:40:28 +00:00
This, that and the other
6cbdf65b4f Add $wgLocalInterwikis to handle multiple local prefixes
This is akin to $wgSkipSkin/$wgSkipSkins. It is quite plausible for a wiki
to have more than one self prefix (e.g. enwiki has w: en: wikipedia: and
maybe others).

Some recent changes code seems to use $wgLocalInterwiki for quite unclear
purposes:
- I removed the line using $wgLocalInterwiki from the RecentChange
  class, as the 'lang' field of $mExtra is not used anywhere in core code.
  Extensions may use it, but it would seem more appropriate for them to
  use something like $wgDBname (or indeed to consult $wgLocalInterwikis
  directly) if they need to identify a particular wiki.
- In the IRC formatter, the first prefix in the array is used (if set).
  Appropriate documentation is added to DefaultSettings.php.

Related to bug 954 comment 3.

Bug: 954
Bug: 955
Change-Id: I9dbb566385b464402c5e78510b95dd2ffb4d9489
2014-03-12 13:32:07 +01:00
aude
1c6b7c7485 Add RCCacheEntryBuilder, split from EnhancedChangesList and cleaned up
This makes it more feasible for Wikibase, Flow, etc. to support
enhanced changes format, and allow better support for the rc_source
column in the future.

Change-Id: I873f6b86007000a94337f0c963df4bf8fec5b715
2014-03-12 11:23:49 +01:00
Erik Bernhardson
4029c76d25 Only generate date header when rendering is guaranteed
The OldChangesListRecentChangesLine hook can skip rendering of
a particular rc line.  If that line was the one that would have
added a new date header then no date header is output.  The
pushes checking for a new date header until after we know a
line will be output so none of the headers get lost.

Change-Id: I64ddd99c6af0b562802504b803563cf77fc2eb28
2014-03-03 14:37:19 -08:00
Siebrand Mazeland
f077c4b1d6 Update formatting
Change-Id: I18aff576262479c9bb1c56eb8e1d1aaae200e4b1
2014-02-06 09:27:05 +01:00
umherirrender
712cdc59af Remove outdated todo from RecentChange.php
Documentation was added with r85781

Change-Id: I769e2a340dee3e41a0b7b05fe856f54bd55a32e6
2014-02-01 11:44:37 +01:00
jenkins-bot
ddb03593a1 Merge "Changes list legend modules cleanup" 2014-01-24 00:55:23 +00:00
Reedy
896149ec79 Short circuit in notifyRCFeeds
Save instantiating classes unnecesserily

Add getEngine return type hint. Also make public

Change-Id: Ie2610516f99fe7b01742e7e95e13c4b1b90c77d7
2014-01-22 07:18:27 +00:00
Bartosz Dziewoński
2ec4ed4711 Changes list legend modules cleanup
The legend is not part of the ChangesList itself, but a part of the
ChangesListSpecialPage; move around modules and calls appropriately.

Followup to I02f2ced4.

Change-Id: I2c8922135404aab1960158cee06e2d8d07a1ace7
2014-01-16 19:26:43 +01:00