Samwilson has uploaded a new change for review.

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

Change subject: Fix hook loading
......................................................................

Fix hook loading

Change-Id: If497009e03bcfb9c4e135deefcd7ac6421d18335
---
M extension.json
R src/Hooks.php
2 files changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Genealogy 
refs/changes/21/321221/1

diff --git a/extension.json b/extension.json
index 98d640a..bbfc903 100644
--- a/extension.json
+++ b/extension.json
@@ -19,9 +19,9 @@
                "\\Samwilson\\Genealogy\\Hooks": "src/Hooks.php"
        },
        "Hooks": {
-               "ParserFirstCallInit": 
"\\Samwilson\\Genealogy\\Util::onParserFirstCallInit",
-               "UnitTestsList": "Samwilson\\Genealogy\\Util::onUnitTestsList",
-               "EditPageBeforeEditToolbar": 
"Samwilson\\Genealogy\\Util::onEditFormInitialText"
+               "ParserFirstCallInit": 
"\\Samwilson\\Genealogy\\Hooks::onParserFirstCallInit",
+               "UnitTestsList": "Samwilson\\Genealogy\\Hooks::onUnitTestsList",
+               "EditPageBeforeEditToolbar": 
"Samwilson\\Genealogy\\Hooks::onEditPageBeforeEditToolbar"
        },
        "manifest_version": 1
 }
diff --git a/src/Util.php b/src/Hooks.php
similarity index 91%
rename from src/Util.php
rename to src/Hooks.php
index b87b737..c54fef6 100644
--- a/src/Util.php
+++ b/src/Hooks.php
@@ -12,7 +12,7 @@
 use WikiPage;
 use Xml;
 
-class Util {
+class Hooks {
 
        /**
         * Hooked to ParserFirstCallInit.
@@ -36,25 +36,25 @@
        }
 
        /**
-        * This method is called by the editFormInitialText hook and adds a 
list of the current page's
-        * Genealogy partners that *aren't* a result of a 
{{#genealogy:partner}} call in the current
-        * page.
-        * @param string $formInitialText The existing initial text of the form
+        * This method is called by the EditPageBeforeEditToolbar hook and adds 
a list of the current
+        * page's Genealogy partners that *aren't* a result of a 
{{#genealogy:partner|…}} call in the
+        * current page.
+        * @param string $toolbarHtml The existing toolbar HTMl.
         * @return void
         */
-       public static function onEditFormInitialText( &$formInitialText ) {
+       public static function onEditPageBeforeEditToolbar( &$toolbarHtml ) {
                global $wgTitle;
                $person = new Person( $wgTitle );
                $peopleList = [];
                foreach ( $person->getPartners( true ) as $partner ) {
                        $peopleList[] = '<a 
href="'.$partner->getTitle()->getLinkURL().'">'
-                                       .$partner->getTitle()->getText()
-                                       ."</a>";
+                               .$partner->getTitle()->getText()
+                               ."</a>";
                }
                if ( count( $peopleList ) > 0 ) {
                        $msg = wfMessage( 'genealogy-existing-partners', count( 
$peopleList ) );
                        $successBox = '<p class="successbox">' . $msg. join( ', 
', $peopleList ) . '</p>';
-                       $formInitialText = $successBox . $formInitialText;
+                       $toolbarHtml = $successBox . $toolbarHtml;
                }
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/321221
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If497009e03bcfb9c4e135deefcd7ac6421d18335
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Genealogy
Gerrit-Branch: master
Gerrit-Owner: Samwilson <s...@samwilson.id.au>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to