Page MenuHomePhabricator

[[Special:Oversight]] should have a diff link
Closed, ResolvedPublic

Description

Author: mcdevitd

Description:
[[Special:Oversight]] should show diffs as well as a revisions so that we can
see what was changed and easily locate what the offending material was that was
hidden.


Version: unspecified
Severity: enhancement

Details

Reference
bz8131

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:29 PM
bzimport set Reference to bz8131.

Patch to add diffs to oversight

This patch show the diff (if possible) of the hidden revision to last remaining
revision before it. If this revision was the first or the page was archived, it
returns an MediaWiki message error.

This is not a high-traffic area, so no caching is called.

Here are the MW: messages used:
*oversight-header - page explanation...blah
*oversight-nodiff - diff can't be made, first or page deleted
*oversight-difference - "(Difference from previous remaining revision)"
*oversight-id - "(Previous ID="
*oversight-prev - "last previous revision"
*oversight-hidden - "hidden revision"

attachment oversight2.patch ignored as obsolete

Update; fix bugs, remove need for oversight-id message

attachment oversight2.patch ignored as obsolete

Update; XHTML comp, remove need for MW messages

attachment oversight2.patch ignored as obsolete

Haven't tested, but some comments from first reading:

+ $compare = $wgRequest->getIntOrNull( 'compare' );
+ if ( $compare == 1 && !is_null( $revision )) {

Since the value of the compare parameter isn't used, you should probably just
use getCheck and a nice true/false comparison.

Or actually, it might be better to use 'diff' and 'oldid' parameters in a way
that's more consistent with regular diffs.

+ $wgOut->addHtml( 'Below is a list of revisions permanantly hidden from public
view.<br></br>

Above is not localized and, bad HTML.
Set it up as a message, add it as wikitext, and use <br/> if it's necessary to
use a br.

+ $text = strval( $rev->getText() );
...
+ if (strlen($text) < 1) {
+ $wgOut->addHtml(wfmsg('hiderevision-error-missing'));
+ } else {

This is incorrect; revisions may legitimately be zero-length strings.
For error conditions, check for null (?) return values.

[Also there's some funky whitespace and inconsisent case on the function name here.]

+ "<p>Unable to track changes as there is currently no previous revision for
the page. Either:</p><ul>" .
[snip]

Text not localized; move these to messages, preferably wiki-format.

Update; messages localized like the rest, minor fixes

It now uses &diff=(0 or 1) to denote comparisons, and uses getCheck to make a
true/false comparison. Revisions error check for null rather than blank revs.

attachment oversight2.patch ignored as obsolete

Add "oversight-difference" message

attachment oversight2.patch ignored as obsolete

Update: fix some things Rob pointed out

attachment oversight2.patch ignored as obsolete

Fix newlines, more consistant case/spacing use

attachment oversight2.patch ignored as obsolete

Update; support internationalization

attachment HideRevision.php ignored as obsolete

robchur wrote:

Comment on attachment 2946
Update; support internationalization

This isn't a patch; it's a full file.

Update; support internationalization

Wrong file, I just noticed that when I clicked [diff]

attachment oversight2.patch ignored as obsolete

Update HideRevision.i18n - add some french bits

attachment hiderevint.patch ignored as obsolete

Update HideRevision.i18n - add some needed messeges

attachment hiderevint.patch ignored as obsolete

robchur wrote:

I don't quite understand the changing of two instances of $skin->makeLinkObj()
to $skin->makeKnownLinkObj() - these will cause false bluelinks when the pages
don't exist.

Use LinkObject correctly for usern links

attachment oversight2.patch ignored as obsolete

Unified diff

attachment oversight2.patch ignored as obsolete

Update

Secure form more, remove commented out line, some Msg changes.

attachment oversight2.patch ignored as obsolete

Fix one fr message

Attached: