Page MenuHomePhabricator

Move Content::getParserOutput method that don't belong in Content to ContentHandler
Closed, ResolvedPublic

Description

We moved Content methods ::getParserOutput and ::fillParserOutput to ContentHandler on core Patch

So we also need to do it with CampaignContent content that extend it in MediaUploader extension.
The idea is to override method fillParserOutput in CampaignContentHandler and move implementation of CampaignContent::fillParserOutput there.

Event Timeline

Ostrzyciel triaged this task as Medium priority.Oct 11 2021, 3:19 PM
Ostrzyciel moved this task from To Triage to Compat/Interoperability on the MediaUploader board.
Ostrzyciel subscribed.

Great, that should simplify the mess around content handlers, I'll look into it in a few days. Probably some serious refactoring will be involved.

Change 730888 had a related patch set uploaded (by Ostrzyciel; author: Ostrzyciel):

[mediawiki/extensions/MediaUploader@master] Move getParserOutput to CampaignContentHandler

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

@roman-stolar I've submitted an initial version of the excessively large patch, but there's really one interesting piece of code here: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MediaUploader/+/730888/1/includes/Campaign/CampaignContent.php#172

I've kept this override in CampaignContent so that the extension can work with both 1.38 and 1.37. It does sadly necessitate calling internal methods, but I don't see any way around this. I'll remove this back-compat with the first release that starts emitting deprecation warnings over this (1.39?).

Change 730888 merged by jenkins-bot:

[mediawiki/extensions/MediaUploader@master] Move getParserOutput to CampaignContentHandler

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

Ostrzyciel claimed this task.