r91453 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91452‎ | r91453 | r91454 >
Date:12:48, 5 July 2011
Author:demon
Status:reverted (Comments)
Tags:
Comment:
(bug 5800) Added $formCallback as a parameter to the hook EditPage::showEditForm:initial
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -726,6 +726,7 @@
727727
728728 'EditPage::showEditForm:initial': before showing the edit form
729729 $editor: EditPage instance (object)
 730+$formCallback: Array for callback of modifying the edit form
730731
731732 Return false to halt editing; you'll need to handle error messages, etc.
732733 yourself. Alternatively, modifying $error and returning true will cause the
Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -64,6 +64,8 @@
6565 the relevant section of the category.
6666 * (bug 29109) Allow the automatic edit summary for redirect creation
6767 show the first bit of the new redirect page.
 68+* (bug 5800) Added $formCallback as a parameter to the hook
 69+ EditPage::showEditForm:initial
6870
6971 === Bug fixes in 1.19 ===
7072 * (bug 28868) Show total pages in the subtitle of an image on the
Index: trunk/phase3/includes/EditPage.php
@@ -1335,7 +1335,7 @@
13361336 $previewOutput = $this->getPreviewText();
13371337 }
13381338
1339 - wfRunHooks( 'EditPage::showEditForm:initial', array( &$this ) );
 1339+ wfRunHooks( 'EditPage::showEditForm:initial', array( &$this, &$formCallback ) );
13401340
13411341 $this->setHeaders();
13421342

Follow-up revisions

RevisionCommit summaryAuthorDate
r93916Self-revert r91453: not a well thought out addition to the EditPage::showEdit...demon21:04, 4 August 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   16:27, 5 July 2011

How should this be handled when there's already a callback passed to EditPage::showEditForm -- is it the new callback's responsibility to save and call the previous callback?

#Comment by Aaron Schulz (talk | contribs)   20:59, 4 August 2011

I had the same question.

Status & tagging log