Page MenuHomePhabricator

Provide a reliable way for extensions to run postmerge hooks
Open, Needs TriagePublic

Description

Currently, several extensions are manually running postmerge hooks like EditFilterMergedContent, which core runs in EditPage. This is bad because it introduces code duplication, extensions are required to implement proper error handling, and in general, they need to run this hook whenever saving a page in a way that doesn't involve EditPage (which is easy to understand, since EditPage is a huge monster).

MW core should provide a way to avoid this, by either:

  • Providing a public method that can be used to run the hook with proper error handling etc. (this is good as a temporary solution)
  • Moving this functionality somewhere down the line (e.g. PageUpdater), so that any code using EditFilterMergedContent can use the new hook instead (perhaps better as a long-term solution, but needs careful planning)