Page MenuHomePhabricator

Some edits cannot be thanked in page histories with imported revisions
Closed, ResolvedPublic

Description

As you can see here, it's impossible to thank for edits done with the ContentTranslation tool. This shouldn't be the case.

Details

Related Gerrit Patches:
mediawiki/extensions/Thanks : masterAllow thanking discontinuous revisions

Event Timeline

MGChecker created this task.Feb 4 2018, 8:17 PM
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptFeb 4 2018, 8:17 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I'm not sure why is it impossible to thank using your link.

It's possible to thank using this link.

Maybe it's because of type=revision?

This isn't the same diff, @Amire80. The thanks link is displayed neither in the history nor in the diff.

Catrope added a subscriber: Catrope.Feb 6 2018, 7:08 PM

There's a rev_parent_id discontinuity in that page's history. I think it might be because the edit you're pointing to is the one that originally created the page (since it has rev_parent_id=0), and there is imported history that comes before it chronologically.

There's a line in ThanksHooks::insertThankLink() that checks for rev_parent_id continuity (( !$oldRev || $rev->getParentId() == $oldRev->getId() )), which would cause this revision to not have a thank link because of the discontinuity. But I'm not sure why that check is there.

Catrope renamed this task from It's impossible to thank for edits done by ContentTranslation to Some edits cannot be thanked in page histories with imported revisions.Mar 6 2018, 7:15 PM
Catrope added subscribers: Perhelion, FriedhelmW.

From the duplicate:

As someone reported (on DeWP technical workshop, TWS) the thanks button is missing on imported versions but curiously not in the mobile version (or per special page: https://de.wikipedia.org/wiki/Special:Thanks/173093813):
https://de.wikipedia.org/wiki/Spezial:MobileDiff/173093813
https://de.wikipedia.org/wiki/Spezial:Diff/173093813

Cirdan added a subscriber: Cirdan.Jul 19 2018, 7:06 PM

In case this helps with triaging, this issue came up at the German-language Wikipedia's Village Pump today.

Specifically, the user wondered why they could not thank another user for this translation (oldid is younger than curid).

Restricted Application added a project: Growth-Team. · View Herald TranscriptJul 19 2018, 7:06 PM
kostajh claimed this task.Sep 7 2018, 4:50 PM
kostajh triaged this task as Medium priority.

Some options for resolving this:

  1. Revert rETHA75c88532653e: Remove misleading Thank button from some diffs
  2. Revert rETHA75c88532653e: Remove misleading Thank button from some diffs, and on Special:Thanks/{revId} (e.g. https://de.wikipedia.org/wiki/Spezial:Danke/173093813) load the diff summary of {revId} and previous revision so the user has context about what specifically they are thanking
  3. Modify code so that functionality from rETHA75c88532653e: Remove misleading Thank button from some diffs is retained (do not allow "thanks" for diff of multiple revisions) but add an exclusion for cases when there is a content translation, which we'd somehow have to detect
  4. Revert rETHA75c88532653e: Remove misleading Thank button from some diffs and modify the code to look at adjacent revisions (i.e. ( !$oldRev || $rev->getPrevious()->getId() == $oldRev->getId() )) rather than the existing logic of ( !$oldRev || $rev->getParentId() == $oldRev->getId() )
SBisson added a subscriber: SBisson.EditedSep 20 2018, 6:00 PM

AFAICT the option #4 would preserve the initial fix for diff pages spanning multiple revisions while allowing thanks links for history entries for pages with discontinued revisions.

Change 461709 had a related patch set uploaded (by Sbisson; owner: Sbisson):
[mediawiki/extensions/Thanks@master] Allow thanking discontinued revisions

https://gerrit.wikimedia.org/r/461709

SBisson claimed this task.EditedSep 20 2018, 7:10 PM
SBisson moved this task from In Progress to Code Review on the Growth-Team (Current Sprint) board.
SBisson added a subscriber: kostajh.

In the patch above, I've just implemented @kostajh's suggestion #4. He has done the work of figuring it out.

Change 461709 merged by jenkins-bot:
[mediawiki/extensions/Thanks@master] Allow thanking discontinuous revisions

https://gerrit.wikimedia.org/r/461709

Etonkovidova closed this task as Resolved.Oct 5 2018, 7:40 PM
Etonkovidova added a subscriber: Etonkovidova.

Re-checked the links - the diffs have 'danken' links, so from diff 'thank' action could be done:

and in history too:

@Amire80 There seem to be some deficiencies when an article that was translated is imported via Special:Import log - filed as T206360: Special:Import does not preserve Tag:ContentTranslation .