Page MenuHomePhabricator

[Bug] Diffs in wikibase show edit links
Closed, ResolvedPublic

Description

Probably caused by https://gerrit.wikimedia.org/r/#/c/393260
It caused master of Wikibase fails in jenkins tests: https://gerrit.wikimedia.org/r/#/c/394390/

Event Timeline

We can't merge any patch there now.

In MediaWiki core, the rendered page view shown when viewing a diff has edit links if it is for the latest version, and does not have those links otherwise. rEWBA0331ae041dce: Use ParserOutputPostCacheTransform hook to avoid splitting cache on… removed where Wikibase was overriding this for its overridden view action, which brings it in line with the core behavior.

But the tests (and wbIsEditView) weren't updated to match. I'll have a look at that.

Change 394642 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/extensions/Wikibase@master] Remove 'wbIsEditView' JS config var

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

thiemowmde renamed this task from Diffs in wikibase show edit links to [Bug] Diffs in wikibase show edit links.Dec 4 2017, 8:56 AM
thiemowmde moved this task from incoming to in progress on the Wikidata board.

Change 394962 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/Wikibase@master] Skip the diff in Wikibase tests for now

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

Change 394962 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Skip the diff in Wikibase tests for now

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

Change 394973 had a related patch set uploaded (by Thiemo Mättig (WMDE); owner: Thiemo Mättig (WMDE)):
[mediawiki/extensions/Wikibase@master] Never show edit section links in entity diffs

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

What is presented in https://gerrit.wikimedia.org/r/394642 is definitely not the way to go, as it simply removes an entire feature instead of fixing the issue. The removed feature is also pretty much unrelated to what's going on. I'm currently hunting down the issue, and found that RepoHooks::onParserOutputPostCacheTransform is called with enableSectionEditLinks enabled on diffs that contain the latest revision. I expect diffs to never have section edit links.

The issue appears to be that the ParserOutput created via EntityContentDiffView::getParserOutput (called in line #629 of DifferenceEngine) is either never passed to the ParserOutputPostCacheTransform hook (which my patch fixes by doing again what the hook was supposed to do), or the hook is called with a bad enableSectionEditLinks option (as described above).

I expect diffs to never have section edit links.

Your expectation does not match reality in MediaWiki core. See, for example, https://en.wikipedia.org/w/index.php?title=Barack_Obama&diff=cur&oldid=813429763. This has been the intended behavior since 2004 (rSVN2777). See also T4614.

Wikibase used to override this for its own diffs using a long-since-deprecated parser option (see T168543) which is now fully deprecated.

Change 394642 abandoned by Anomie:
Remove 'wbIsEditView' JS config var

Reason:
I only submitted this because Ladsgroup was UBN over T181807. Feel free to unabandon if you decide this is useful after all.

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

Sorry for the misunderstanding. When I wrote "I expect diffs to never have edit buttons" I means diffs in a Wikibase entity namespace (items, properties, lexemes, …). The way we achieved this in the past was clearly not optimal.

I was looking for a much cleaner way to achieve this but could not find any. The easiest way would be to forcefully set the parser option "enableSectionEditLinks" to false. But it looks like all methods that previously allowed this are either removed or deprecated. I also wrote a longer comment about this in https://gerrit.wikimedia.org/r/394973.

Lucas_Werkmeister_WMDE lowered the priority of this task from High to Medium.Dec 5 2017, 1:21 PM

Change 394973 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Never show edit section links in entity diffs

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

thiemowmde claimed this task.
thiemowmde moved this task from Review to Done on the Wikidata-Sprint-2017-12-06 board.
thiemowmde removed a project: Patch-For-Review.