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
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
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
- 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
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
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
When non-existent categories appear in the changelist
they wont get marked reddue to the use of
Linker::linkKnown.
Bug: T126854
Change-Id: I3dc9746c0fe55e81ffd2df1c04ade6950efcc020
$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
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
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
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
Deprecated since 1.22 and not used in any extension
hosted in Wikimedia git (and afaik elsewhere).
Change-Id: I0974ba80b7ab21b056d7f16e936b5c564b562e6d
Rewrite a chunky HTML string concatenation party as Mustache template
rendering. This decouples the view from the controller.
Bug: T120921
Change-Id: I3217b80168f89e7b91dbc33a7053865ad3408615
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
Move ad-hoc variables under an array, in preparation for merging with
RC flags implemented by extensions.
Bug: T120921
Change-Id: I5dd91ba5e5ed36785d9fbf01673defcd227c8b01
* 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
This makes the delete() calls work properly for all DCs.
Also, using the message cache was fairly bizzare.
Change-Id: Idec7fa47811e982ba89bb8fbbd9565a26585e77f
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
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
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
This adds optional flags to Revision::getRecentChange
And uses them in CategoryMembershipChange
Bug: T109700
Change-Id: I197ebccf1f62cdcb03ce4daa2527b973e495236c
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
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
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
$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
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
Introduce a new hook to allow (single) block-level entries.
Very similar to EnhancedChangesListModifyLineData.
Bug: T104399
Change-Id: I6b4715277d44e5f09d7a230b33e956676aeab1c2
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
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
* Make MachineReadableRCFeedFormatter use it
* Some unit tests
* Also fixed some line-too-long warnings in RecentChange.php
Change-Id: I443d14f5d4cdac0945cb9c03608d55745bbb865b
* 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
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
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
* Also added a selectFieldValues helper method to the DB classes
since this use case keeps coming up.
Change-Id: I62cdbb497dc2c8fe4758e756d13688b85165e869
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
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
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
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
- 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
- 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
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
Like we do in ApiQueryRecentChanges as well, expose the named
rc.type property, not the internal integer constants.
Change-Id: I89a948eee999032bb2e42cc23345affa879afb42
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
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
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
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
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
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
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
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
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
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
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
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
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
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
DELETED_ACTION is supposed to hide the target of the log entry. But a
few places weren't doing this properly.
This fixes:
* API list=logevents no longer returns the pageid when the target is
hidden.
* Enhanced RecentChanges no longer includes the log target page in the
CSS class. This should also make the CSS class actually useful.
* Watchlist no longer shows log entries with DELETED_ACTION unless the
user has deletedhistory, and with SUPPRESSED_ACTION unless the user
has suppressrevision.
Bug: 58699
Change-Id: I57f13bfc970a33ffd5a399ffb450d9ed0b77902f
* Document class property type
* Update documentation and doc formatting
* Ensure variables are defined
Change-Id: I0c7db08d27ac807e989b626c36e72ae52be85d52
For consistency with SpecialRecentChanges.
This introduces no incompatibilities as PHP classes are case-insensitive.
Change-Id: I5855074deed52fd7492f033c8a8fced8af647602
Some of the code added here is duplicated, redundant or would be
better off placed somewhere else. I know about this, but this is not
the time to fix that (and nobody would review such patches anyway…).
Bug: 52005
Change-Id: I02f2ced42f33649b6c972d35a4739372ca265e10
This affects Watchlist, RecentChanges and RecentChangesLinked.
A <div class="mw-changeslist-empty" /> is already used on all of these
when the list isn't generated (somewhat inconsistently coded, though).
Bug: 8844
Change-Id: I1ab2a54e22f318713c2211d63b29c184751a3589
$cachedEntry gets set with baseRC, so baseRC timestamp is the
same as $cachedEntry timestamp.
Doing things this way makes it more feasible to split out some
of the change formatting code.
Change-Id: I1cae6174c827802d525bb95ed152c64008ce7360
Used in SpecialRecentChanges, ChangesList and SpecialWatchlist to keep
track of line numbers for RC list entries.
Change-Id: Ib0e76a325c36a5c019db8d55c150e3bf3bf1d19b
All are referenced directly outside inheritence; declare all public.
Removed unused $mMovedToTitle.
Change-Id: I3ba8f377e1a1082d3a2bb4b043e10bc351c0b5dd
* Define dynamic class properties
* Update documentation and doc formatting
* Ensure variables are defined
Change-Id: I309affea9a8e8cfa24bd8fe694a16bf79d6f2419
All are referenced directly outside inheritence; declare all public.
Removed unused $secureName and $versionlink.
Change-Id: If491d0f1cbf4d53692e0ecfd0e1df1f4c3761ca6
Field is unused since many versions, so remove the use in sql
statements, to allow dropping in a later version.
The field must not be reference from INSERT because it has a default
value, which is used, when no value is specified in the statement.
Keeping the field allows easier rollback on version update, when
something gets wrong with the new version.
Existing Comment in tables.sql was added with r101293, was already
disused in r11088
Bug: 40667
Change-Id: I4a9c2fa813d1f25dfb755e564f7677a212934d7b
newFromUser() is unused in core and all extensions in gerrit,
except BlueSpiceExtensions RSSStandards. (there is a
patch for that I1455052)
Change-Id: I4559146cc0e9973e6e4f6297138cbfd8e387e8b7
On SpecialRecentChanges, the unpatrolled "bang" icon is only
rendered when:
- the user has the patrol right.
- the rc type is EDIT and rcpatrol is permitted, or
the tc type is NEW and nppatrol is permitted.
- the rc event is in fact still unpatrolled.
In other words, when an edit is patrollable and unpatrolled.
However, consumers of the API are unable to render this because
the API only has a boolean "patrolled" attribute. Apps using
the absence of "patrolled" and presence of "patrol" right as
meaning "unpatrolled" get into trouble on wikis with RCpatrol
disabled and NPpatrol enabled. In those cases the app would
render a change as unpatrolled, but when the user clicks it
find out it can't be patrolled.
This adds an "unpatrolled" flag that does just that.
Change-Id: Ic947c6c75eb7936fcebdccbcd27ff62e07f1feda