Page MenuHomePhabricator

ParserOutput::recordOption( 'editsection' ) should no longer be used
Closed, ResolvedPublic

Description

repo/includes/Content/EntityContent.php calls $output->recordOption( 'editsection' ) to try to fragment the parser cache on whether section edit links are included.

MediaWiki core has not so fragmented the cache since February 2015, and with the recent ParserOptions changes we now have to maintain a hack to keep that varying working just for Wikibase. A new fix for T85252: Edit buttons are getting cached, although their visibility depends on user rights is needed so we can remove that hack.

Suggestions:

  • Do edit links after the fact somehow instead of fragmenting the cache, like core does.
  • Use ParserOptions::addExtraKey() to do the fragmenting.
  • Use the new ParserOptionsRegister hook to register your own cache-fragmenting option for use in place of 'editsection'.

Event Timeline

Anomie created this task.Jun 21 2017, 4:53 PM
Restricted Application added a project: Wikidata. · View Herald TranscriptJun 21 2017, 4:53 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 393279 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/extensions/Wikibase@master] Use ParserOutputPostCacheTransform hook to avoid splitting cache on 'editsection'

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

Change 393737 had a related patch set uploaded (by Thiemo Mättig (WMDE); owner: Thiemo Mättig (WMDE)):
[mediawiki/extensions/Wikibase@master] Remove unused $editable flag and EmptyEditSectionGenerator

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

Change 393279 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Use ParserOutputPostCacheTransform hook to avoid splitting cache on 'editsection'

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

Anomie closed this task as Resolved.Dec 1 2017, 8:55 PM
Anomie claimed this task.