Addshore has uploaded a new change for review.
https://gerrit.wikimedia.org/r/205299
Change subject: Fix submit button targets on SpecialPage
......................................................................
Fix submit button targets on SpecialPage
This removes the hardcoded ?action=FOO
actions and instead adds the action as a hidden
form element and posts to the title (which is now
set)
Change-Id: I267e0f47d2f53acea94fdc239926ba3995cae600
---
M src/MassActionSpecialPage.php
1 file changed, 15 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassAction
refs/changes/99/205299/1
diff --git a/src/MassActionSpecialPage.php b/src/MassActionSpecialPage.php
index c68500f..6e274c8 100644
--- a/src/MassActionSpecialPage.php
+++ b/src/MassActionSpecialPage.php
@@ -184,10 +184,13 @@
'type' => 'hidden',
'default' => $task->getId(),
),
+ 'action' => array(
+ 'type' => 'hidden',
+ 'default' => 'saveall',
+ ),
) );
$changeForm->setContext( $this->getContext() );
- $changeForm->setAction( '?action=saveall' );
- $changeForm->setTitle( Title::newMainPage() );
+ $changeForm->setTitle( Title::newFromText(
'MassAction/View/' . $task->getId(), NS_SPECIAL ) );
$changeForm->setSubmitText( 'Save All' );
$changeForm->prepareForm();
$html .= $changeForm->getHtml( '' );
@@ -207,10 +210,13 @@
'type' => 'hidden',
'default' => $target->getId(),
),
+ 'action' => array(
+ 'type' => 'hidden',
+ 'default' => 'savetarget',
+ ),
) );
$changeForm->setContext( $this->getContext() );
- $changeForm->setAction( '?action=savetarget' );
- $changeForm->setTitle( Title::newMainPage() );
+ $changeForm->setTitle( Title::newFromText(
'MassAction/View/' . $task->getId(), NS_SPECIAL ) );
$changeForm->setSubmitText( 'Save' );
$changeForm->prepareForm();
$saveTargetButtonHtml = $changeForm->getHtml(
'' );
@@ -276,6 +282,10 @@
'type' => 'hidden',
'default' => $target,
),
+ 'action' => array(
+ 'type' => 'hidden',
+ 'default' => 'newtask',
+ ),
),
$this->getMatchersFormDescription( $target ),
$this->getActionsFormDescription( $target )
@@ -283,8 +293,7 @@
$htmlForm = new HTMLForm( $formDescription );
$htmlForm->setContext( $this->getContext() );
- $htmlForm->setTitle( Title::newMainPage() );
- $htmlForm->setAction( '?action=newtask' );
+ $htmlForm->setTitle( Title::newFromText( 'MassAction/New/' .
ucfirst( $target ), NS_SPECIAL ) );
$htmlForm->setDisplayFormat( 'div' );
$htmlForm->prepareForm();
$this->getOutput()->addHTML( $htmlForm->getHTML( '' ) );
--
To view, visit https://gerrit.wikimedia.org/r/205299
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I267e0f47d2f53acea94fdc239926ba3995cae600
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassAction
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits