This allows derivative DifferenceEngine classes to
generate cache keys in a different format, as appropriate.
(e.g. for Wikibase, allow diffs to be cached by language
and fully localized)
Bug: 55667
Change-Id: I22bf4e70f86da832a86baf6790ad4a403fce4bf1
== Prelude ==
wl_notificationtimestamp controls sending the user e-mail
notifications about changes to pages, as well as showing the "updated
since last visit" markers on history pages, recent changes and
watchlist.
== The bug ==
Previously, on every view of a page, the notification timestamp was
cleared, regardless of whether the user as actually viewing the latest
revision. When viewing a diff, however, the timestamp was cleared only
if one of the revisions being compared was the latest one of its page.
The same behavior applied to talk page message indicators (which are
actually stored sepately to cater to anonymous users).
This was inconsistent and surprising when one was attempting to, say,
go through the 50 new posts to a discussion page in a peacemeal
fashion.
== The fix ==
If the revision being viewed is the latest (or can't be determined),
the timestamp is cleared as previously, as this is necessary to
reenable e-mail notifications for given user and page.
If the revision isn't the latest, the timestamp is updated to
revision's timestamp plus one second. This uses up to two simple
(selectField) indexed queries per page view, only fired when we
do not already know we're looking at the latest version.
Talk page indicator is updated to point at the next revision after the
one being viewed, or cleared if viewing the latest revision. The
UserClearNewTalkNotification hook gained $oldid as the second argument
(a backwards-compatible change). In Skin, we no longer ignore the
indicator being present if we're viewing the talk page, as it might
still be valid.
== The bonus ==
Comments and formatting was updated in a few places, including
tables.sql and Wiki.php.
The following functions gained a second, optional $oldid parameter
(holy indirection, Batman!):
* WikiPage#doViewUpdates()
* User#clearNotification()
* WatchedItem#resetNotificationTimestamp()
DifferenceEngine gained a public method mapDiffPrevNext() used
to parse the ids from URL parameters like oldid=12345&diff=prev,
factored out of loadRevisionIds(). A bug where the NewDifferenceEngine
hook would not be called in some cases, dating back to its
introduction in r45518, was fixed in the process.
Bug: 41759
Change-Id: I4144ba1987b8d7a7e8b24f4f067eedac2ae44459
wfDl() is a wrapper around dl(), which is an evil function and
basically only works from the command line of Zend. Luckily
no extension has ever used this thing, so let's just remove it
outright.
For comparison, here's a list of places it does not work:
- hhvm
- php as apache module
- php compiled with zts support
- safe_mode
- Basically any shared host that cares about security
Most callers are using it to check for extension support and are
actually failing gracefully when wfDl() returns false. In these
places we're just going to use extension_loaded().
While we're at it, clean up some of the test skip logic in the
media tests so we can bail as early as possible if we know we
can't complete the test.
This also immediately removes $wgLoadFileinfoExtension. It's been
enabled by default since 5.3 and falls back gracefully when the
support isn't available.
Change-Id: Ieb430dfc74483731dde51d6e20fa700d641ba1f4
Currently if the revision exists but its content is not found, it will make
loadText() return false; which in turn will make a call to showMissingRevision()
from showDiff(). However since the revision exists; it will not match the
condition in showMissingRevision() and thus an error message will appear without
any revision ID.
Change-Id: Idd8a5f20a3c082a3b02bd77557e0f4dc4c66e876
The "if" always exit, so there is no need to use else branches;
also added blank lines for better readability.
Change-Id: I7d8321652a90fbba99e53fa0c1fe018492883b8a
Add the moment the message is added within a class=diff-multi,
which is not true.
Bug: 53168
Follow-Up: I458fb688b0001fb674ece65b3fdabf56fc658a29
Change-Id: Ic3040ceca4ff1459181c84f041490e9e72b12802
This makes it easier to see the fact, because without a hint, the user
can mean, that there is something missing, but here the missing is okay
and for that, the message is helpful.
Change-Id: I458fb688b0001fb674ece65b3fdabf56fc658a29
This adds two very simple queries for every diff page view.
It could be made to only add one (loading tags for both revisions at
once), but it would be a little ugly.
It could even be made to add zero, but this would require either
rewriting and duplicating a lot of code here and constructing
Revisions by hand or making the Revision itself know about its tags.
Bug: 25824
Bug: 49602
Change-Id: Ic2ae58c703db7ceee5de4b320229d8c93810a73b
This prevents a gap from appearing, and the resulting code will be
slightly cleaner as well.
Shouldn't matter in core, but does matter for extensions displaying
diffs like AbuseFilter.
Change-Id: I9e3e74226a23c0a18db091bc1550b694d9d08118
In multi diffs we had a "wrong" value for rc_last_oldid
set (not the directly previous revision but the one
selected by the user). Due to that there weren't any
unpatrolled recentchanges rows found. As that is cached
in memcached these rows stay unpatrollable forever.
Bug: 49019
Change-Id: I5d6111032dba7d102e30d85718639697f44c036e
Affects whether these modules are loaded:
* mediawiki.searchSuggest ($wgEnableAPI only)
* mediawiki.page.watch.ajax ($wgEnableAPI, $wgEnableWriteAPI,
'writeapi' right)
* mediawiki.page.patrol.ajax (same as above)
Checking of $wgUseAjax has not been removed where it was
already present, in case some users have set the variable
to false to disable these specific features.
Bug: 30213
Change-Id: If2ec219cfbb94e7c9718c58b9b54a508d0e0c656
I've changed the logic in Article::showPatrolFooter to be able
to fetch the recent changes id and to only show the patrol link
in case the change hasn't yet been patrolled.
In case recentchanges patrolling is enabled this will try to
create a patrol link for the revision the user is currently
viewing. If only new page patrolling is enabled it tries to
create a patrol link for the first revision of the page.
Furthermore I've removed the passing around of &rcid parameters
within MediaWiki as those had several issues (some even security
related) and were only a workaround to protect the DB from some
queries, which is no longer needed.
This has already been partly implemented in a different manner in
r45778 but had to be reverted in r46542 due to performance issues.
This version shouldn't cause such issues as I'm only adding one or
two indexed database queries per page view.
I've written this new version of the patch with mostly
performance in mind and even tested the database queries it uses
against the replicated databases of enwiki on the toolserver. I'm
pretty sure this can't be implemented any faster without creating
a new index on the recentchanges table.
As I was on it I've implemented RecentChange::isInRCLifespan which
checks whether the given timestamp is new enough to may have a RC
row. That way we can avoid some DB queries for timestamps which are
older than the max RC age.
Fixes bugs:
(bug 15936) New page's patrol button should always be visible
(bug 35810) ! N pages non-patrol-able
(bug 36641) Patrol page link shows on non-existent revs
Change-Id: I1e24733cafbfdc51b7a5a9a1c1baf948e760fe1a
"Quickbar" was a feature of the Standard and CologneBlue skins that
allowed the sidebar to be displayed on left or right side of the page,
floated or fixed, and hidden on diff pages.
Standard was removed (Ia6d73c2d), and CologneBlue doesn't support this
anymore (bug 41246), so all things quickbar can now be safely removed.
* Removed user prefs option + interface
* Removed related messages
* Removed code for this in SkinLegacy
* Removed dead code in DifferenceEngine and Language
Change-Id: I5e6f7d48d6904a052a3a11547d3ebe6161463018
This commit caused a PHP notice if you tried to use diff=prev with an
oldid which was the first revision of the page.
Change-Id: I4c4ccb9a0c8d82e104723a2e72f1c699e2fc249b
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments
Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
To only show rollback links if they work I had to patch Linker
to have a function (Linker::rollbackData) which can verify
that the editor isn't the only editor of the page. Furthermore
it is checked that the user name or the text of the revision
we might rollback to isn't deleted. Due to the fact that I've
altered the already existing method which showed how many edits
a rollback will revert for that, this wont affect the performance.
Change-Id: I5d1adec993370c39ae8c5c712edd919d456441c6
Implement AJAX patrolling with the new mediawiki.page.patrol.ajax
module, which makes use of the API via mediawiki.api.
During the patrol process a spinner (created by jquery.spinner)
shows up and after it a suitable message gets shown via
mediawiki.notify.
Depending on whether we had success or not the link then turns up
again or the brackets completely disappear just like on a normal page view.
On top of adding the module, I've changed the following:
- Added the patrol token to the ResourceLoaderUserTokensModule.
- Registered messages 'markedaspatrollednotify' and
'markedaspatrollederrornotify'.
Change-Id: I472357566dda0ab572c20e2e4b87508b0f2f4c73
Before the introduction of the content handler, missing content was
signified by getText() returning null instead of a string. null will
work much like an empty string in most contexts, so in many places,
it was not checked explcitely whether the conent was null.
Now, when getContent() returns null, this often caused a fatal error,
because the code would access whatever getContent() returned as an object,
without checking whether it was null (because no such check was performed
previously, when the content was represented as a string).
This check introduces explicite checks for getContent() returning null
in the most essential core classes.
Change-Id: I551a90b0b67b8edc7570ca5d252ecc1de903f097
The introduction of the ContentHandler caused quite a few functions and hooks to
become deprecated. Usage of these has been removed in core, but is still present
in extensions. Extensions should be fixed after ContentHandler has settled in a
bit, but for now we need a way to silence the warnings.
Change-Id: Ia223243222675f778e8f8c32923f956790db0b4f
Also passed some $wgUser direct (when already there), so it is seen by
someone, that the user should be passed to that method.
Change-Id: Id4d5504a05ea34d80d59262ad3aef28f09c807a6
- This is needed to for I90965346 ((bug 37453) Move
$wgDisable(Lang|Title)Conversion to ParserOptions)
because that change sets an option based on the Title,
and I don't want to duplicate that to all ParserOptions
that need it.
- Refactored ApiParse to have a WikiPage object available
and changed some part to take advantage of having this
object available. Also used ApiBase::getTitleOrPageId()
to reduce code duplication.
Change-Id: Iec98e472af9c43d940f77261367a796b0d7b4b54