Page MenuHomePhabricator

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


Probably caused by
It caused master of Wikibase fails in jenkins tests:

Event Timeline

Ladsgroup created this task.Dec 1 2017, 2:49 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 1 2017, 2:49 PM
Ladsgroup triaged this task as High priority.Dec 1 2017, 2:50 PM

We can't merge any patch there now.

Anomie added a comment.Dec 1 2017, 6:43 PM

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

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

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

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

What is presented in 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).

Anomie added a comment.Dec 4 2017, 5:03 PM

I expect diffs to never have section edit links.

Your expectation does not match reality in MediaWiki core. See, for example, 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

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

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

Krinkle removed a subscriber: Krinkle.Dec 4 2017, 8:47 PM
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

thiemowmde closed this task as Resolved.Dec 7 2017, 4:12 PM
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.
Aklapper removed subscribers: Jonas, Anomie.Fri, Oct 16, 5:42 PM