Page MenuHomePhabricator

Rollback and mark as patrolled doesn't work
Closed, ResolvedPublic

Description

Author: Nx.devnull

Description:
When I try to roll back an edit to a comment, the rollback silently fails.

Steps to reproduce:
1.Start a new thread
2.Log out
3.Edit the comment as an IP
4.Log back in
5.Go to recent changes, and click the rollback link at the end of the rc line for your IP edit

Actual result:
You are taken to the thread's page, but the edit is not undone

Expected result:
The IP edit should be undone.

This is on MW1.16 beta 3 with r67097 of LiquidThreads.


Version: unspecified
Severity: major

Details

Reference
bz23716

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:01 PM
bzimport set Reference to bz23716.

Nx.devnull wrote:

The same happens with "mark as patrolled", i.e. click on "diff" in RC, then click "mark as patrolled". You are taken to the thread's page, but the edit remains unpatrolled

Another instance of this bug: rollback doesn't work for normal edits on LQT-enabled pages, e.g. http://translatewiki.net/w/i.php?title=User:MaxSem/lqt&action=history

Nx.devnull wrote:

This still doesn't work for me with r74266 and MW1.16

Works for me. Are you sure you are running the trunk branch of Lqt?

Nx.devnull wrote:

Yes, and I checked Dispatch.php too, the modifications are there. Are you using MW1.16? Can it have anything to do with that? Anyway, I'm going to ask for sysop rights on liquidthreads labs and try it there.

Nx.devnull wrote:

I think you've misunderstood me. I'm talking about rollbacks to individual comments, not the page header.

Anyway, it seems the fix for this is simple: in Dispatch.php, in static function threadPermalinkMain, there is a elseif ( $action == 'delete' } branch, just add 'rollback' and 'markpatrolled', i.e.:

		} elseif ( $action == 'rollback' || $action = 'markpatrolled' || $action = 'delete' ) {
			return true;

The current version of LQT tries to call LqtView::postEditUpdates() which doesn't exist any more, so rollback errors out, but it does roll back the edit, and mark as patrolled works. So I'm guessing this should work.

Nx.devnull wrote:

Fixed rollback and mark as patrolled and replaced leftover postEditUpdate

Ok, this seems to work, I replaced the postEditUpdate in onArticleSaveComplete with a hopefully equivalent editMetadataUpdates.

Attached:

Patch committed to trunk.

Thanks very much for your feedback and help in fixing this issue.

Nx.devnull wrote:

*** Bug 27856 has been marked as a duplicate of this bug. ***

(In reply to comment #11)

  • Bug 27856 has been marked as a duplicate of this bug. ***

Would it be possible to backport the fix to MW 1.17 version used on pt.wikibooks?

Patch was applied by r76372 and r76377
I have marked them for deploying on live site by tagging them 1.17wmf1

LiquidThread is a not well updated on live site. I am guessing this is related to a lack of code review, possible security issues or some critical bugs.