Remove parameter 'options' from hook 'SkinEditSectionLinks'
authorFomafix <fomafix@googlemail.com>
Tue, 30 Apr 2019 10:19:51 +0000 (12:19 +0200)
committerFomafix <fomafix@googlemail.com>
Fri, 3 May 2019 13:01:57 +0000 (15:01 +0200)
The generated links are now always known links.

All users of the hook 'SkinEditSectionLinks' in extensions set
'options' => [ 'noclasses', 'known' ]
https://gerrit.wikimedia.org/g/mediawiki/extensions/TinyMCE/+/5f48eb9acd19062a5d6e731ef34b93ef62d3e730/TinyMCE.hooks.php#291
https://gerrit.wikimedia.org/g/mediawiki/extensions/VisualEditor/+/857c1bd3d14ce3a2a98a7d9743fc6120f7d91e9e/includes/VisualEditorHooks.php#617

This change makes it easier to migrate to LinkRenderer in
Ifc170abc958add28a2fe08aa0c44af83c6f7cad8 without legacy options.

Change-Id: Ia5d151b81dabce9560045b45886f2c77abf975da

docs/hooks.txt
includes/skins/Skin.php

index b2f1e81..e90468d 100644 (file)
@@ -3068,7 +3068,6 @@ $tooltip: The default tooltip.  Escape before using.
     - text - String for the text
     - attribs - Array of attributes
     - query - Array of query parameters to add to the URL
-    - options - Array of options for Linker::link
 $lang: The language code to use for the link in the wfMessage function
 
 'SkinGetPoweredBy': TODO
index 4f04278..595a1e8 100644 (file)
@@ -1623,8 +1623,7 @@ abstract class Skin extends ContextSource {
                                'text' => $this->msg( 'editsection' )->inLanguage( $lang )->text(),
                                'targetTitle' => $nt,
                                'attribs' => $attribs,
-                               'query' => [ 'action' => 'edit', 'section' => $section ],
-                               'options' => [ 'noclasses', 'known' ]
+                               'query' => [ 'action' => 'edit', 'section' => $section ]
                        ]
                ];
 
@@ -1634,12 +1633,11 @@ abstract class Skin extends ContextSource {
 
                $linksHtml = [];
                foreach ( $links as $k => $linkDetails ) {
-                       $linksHtml[] = Linker::link(
+                       $linksHtml[] = Linker::linkKnown(
                                $linkDetails['targetTitle'],
                                htmlspecialchars( $linkDetails['text'] ),
                                $linkDetails['attribs'],
-                               $linkDetails['query'],
-                               $linkDetails['options']
+                               $linkDetails['query']
                        );
                }