From 14b524c1185097e96aab258f678991d87c1ac118 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Wed, 15 Feb 2012 19:32:36 +0000 Subject: [PATCH] Add an OutputPage to the EditPage::showEditForm:initial to match the EditPage::showEditForm:fields hook so that people will stop global'ing $wgOut. e.g.: In WikiEditor. --- docs/hooks.txt | 5 +++-- includes/EditPage.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 209ff2ee37..e1f261a19f 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -774,12 +774,13 @@ $request: Webrequest return value is ignored (should always return true) 'EditPage::showEditForm:fields': allows injection of form field into edit form -&$editor: the EditPage instance for reference -&$out: an OutputPage instance to write to +$editor: the EditPage instance for reference +$out: an OutputPage instance to write to return value is ignored (should always return true) 'EditPage::showEditForm:initial': before showing the edit form $editor: EditPage instance (object) +$out: an OutputPage instance to write to Return false to halt editing; you'll need to handle error messages, etc. yourself. Alternatively, modifying $error and returning true will cause the diff --git a/includes/EditPage.php b/includes/EditPage.php index d40925214d..28ace46a08 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1732,7 +1732,7 @@ class EditPage { $previewOutput = $this->getPreviewText(); } - wfRunHooks( 'EditPage::showEditForm:initial', array( &$this ) ); + wfRunHooks( 'EditPage::showEditForm:initial', array( &$this, &$wgOut ) ); $this->setHeaders(); -- 2.20.1