diff --git a/extension.json b/extension.json index 63d8c299c..bfa4de618 100644 --- a/extension.json +++ b/extension.json @@ -61,10 +61,6 @@ "description": "@var string: Navigation popups gadget name", "value": "Navigation_popups" }, - "PopupsConflictingRefTooltipsGadgetName": { - "description": "@var string: Name of a gadget that would cause duplicate reference preview popups. Known conflicting gadgets include \"ReferenceTooltips\", \"CiteTooltip\" alias \"RefTooltip\", \"ReferencePopups\", and \"tooltipRef\" (see T274353).", - "value": "ReferenceTooltips" - }, "PopupsGateway": { "description": "Which gateway to use for fetching Popups data. Available options: [mwApiPlain|restbasePlain|restbaseHTML]. Full and always up to date list is available in src/gateway/index.js", "value": "mwApiPlain" diff --git a/includes/PopupsContext.php b/includes/PopupsContext.php index 9d5abd256..1564368e4 100644 --- a/includes/PopupsContext.php +++ b/includes/PopupsContext.php @@ -115,14 +115,6 @@ class PopupsContext { return $this->gadgetsIntegration->conflictsWithNavPopupsGadget( $user ); } - /** - * @param User $user User whose gadgets settings are being checked - * @return bool - */ - public function conflictsWithRefTooltipsGadget( User $user ) { - return $this->gadgetsIntegration->conflictsWithRefTooltipsGadget( $user ); - } - /** * Are Page previews visible on User Preferences Page * diff --git a/includes/PopupsGadgetsIntegration.php b/includes/PopupsGadgetsIntegration.php index 1d4cd01b0..dc7483f87 100644 --- a/includes/PopupsGadgetsIntegration.php +++ b/includes/PopupsGadgetsIntegration.php @@ -32,18 +32,11 @@ class PopupsGadgetsIntegration { public const CONFIG_NAVIGATION_POPUPS_NAME = 'PopupsConflictingNavPopupsGadgetName'; - public const CONFIG_REFERENCE_TOOLTIPS_NAME = 'PopupsConflictingRefTooltipsGadgetName'; - /** * @var string */ private $navPopupsGadgetName; - /** - * @var string - */ - private $refTooltipsGadgetName; - private ?GadgetRepo $gadgetRepo; /** @@ -56,8 +49,6 @@ class PopupsGadgetsIntegration { ) { $this->navPopupsGadgetName = $this->sanitizeGadgetName( $config->get( self::CONFIG_NAVIGATION_POPUPS_NAME ) ); - $this->refTooltipsGadgetName = $this->sanitizeGadgetName( - $config->get( self::CONFIG_REFERENCE_TOOLTIPS_NAME ) ); $this->gadgetRepo = $gadgetRepo; } @@ -90,27 +81,4 @@ class PopupsGadgetsIntegration { } return false; } - - /** - * Check if Popups conflicts with Ref Tooltips Gadget - * If user enabled Ref Tooltip, Popups is unavailable - * - * @param User $user User whose gadget settings are checked - * @return bool - */ - public function conflictsWithRefTooltipsGadget( User $user ) { - if ( $this->gadgetRepo ) { - $match = array_search( $this->refTooltipsGadgetName, $this->gadgetRepo->getGadgetIds() ); - if ( $match !== false ) { - try { - return $this->gadgetRepo->getGadget( $this->refTooltipsGadgetName ) - ->isEnabled( $user ); - } catch ( \InvalidArgumentException $e ) { - return false; - } - } - } - return false; - } - } diff --git a/tests/phpunit/PopupsGadgetsIntegrationTest.php b/tests/phpunit/PopupsGadgetsIntegrationTest.php index d73f514c3..1d9698b47 100644 --- a/tests/phpunit/PopupsGadgetsIntegrationTest.php +++ b/tests/phpunit/PopupsGadgetsIntegrationTest.php @@ -58,7 +58,6 @@ class PopupsGadgetsIntegrationTest extends MediaWikiIntegrationTestCase { private function getConfig( string $name = self::NAV_POPUPS_GADGET_NAME ): Config { return new HashConfig( [ PopupsGadgetsIntegration::CONFIG_NAVIGATION_POPUPS_NAME => $name, - PopupsGadgetsIntegration::CONFIG_REFERENCE_TOOLTIPS_NAME => $name, ] ); }