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.

Event Timeline

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.

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

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).

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() )

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 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 subscribed.

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

Screen Shot 2018-10-05 at 11.49.45 AM.png (328×1 px, 92 KB)

and in history too:

Screen Shot 2018-10-05 at 12.07.17 PM.png (98×1 px, 59 KB)

@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 .