From ffa6b4de0952ee604061e411f92a38326df82add Mon Sep 17 00:00:00 2001 From: Roman Stolar Date: Thu, 15 Jul 2021 16:40:45 +0200 Subject: [PATCH] Override ContentHandler::getDeletionUpdates and ContentHandler::getSecondaryDataUpdates. Use it instead of Content::getDeletionUpdates and Content::getSecondaryDataUpdates. Bug: T285730 Bug: T285729 Change-Id: Ie4ea0917f120809be59e2b7afad51cd189d64dd1 --- includes/content/GadgetDefinitionContent.php | 28 -------------- .../GadgetDefinitionContentHandler.php | 37 +++++++++++++++++++ 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/includes/content/GadgetDefinitionContent.php b/includes/content/GadgetDefinitionContent.php index 4df6fe71..fd656112 100644 --- a/includes/content/GadgetDefinitionContent.php +++ b/includes/content/GadgetDefinitionContent.php @@ -94,32 +94,4 @@ class GadgetDefinitionContent extends JsonContent { return $info; } - - /** - * @param WikiPage $page - * @param ParserOutput|null $parserOutput - * @return DeferrableUpdate[] - */ - public function getDeletionUpdates( WikiPage $page, ParserOutput $parserOutput = null ) { - return array_merge( - parent::getDeletionUpdates( $page, $parserOutput ), - [ new GadgetDefinitionDeletionUpdate( $page->getTitle() ) ] - ); - } - - /** - * @param Title $title - * @param Content|null $old - * @param bool $recursive - * @param ParserOutput|null $parserOutput - * @return DataUpdate[] - */ - public function getSecondaryDataUpdates( Title $title, Content $old = null, - $recursive = true, ParserOutput $parserOutput = null - ) { - return array_merge( - parent::getSecondaryDataUpdates( $title, $old, $recursive, $parserOutput ), - [ new GadgetDefinitionSecondaryDataUpdate( $title ) ] - ); - } } diff --git a/includes/content/GadgetDefinitionContentHandler.php b/includes/content/GadgetDefinitionContentHandler.php index 2f721668..479f46b1 100644 --- a/includes/content/GadgetDefinitionContentHandler.php +++ b/includes/content/GadgetDefinitionContentHandler.php @@ -1,4 +1,5 @@ getSlotParserOutput( $role, false ). + * @return DeferrableUpdate[] A list of DeferrableUpdate objects for putting information + * about this content object somewhere. + */ + public function getSecondaryDataUpdates( + Title $title, + Content $content, + $role, + SlotRenderingProvider $slotOutput + ) { + return array_merge( + parent::getSecondaryDataUpdates( $title, $content, $role, $slotOutput ), + [ new GadgetDefinitionSecondaryDataUpdate( $title ) ] + ); + } }