jenkins-bot has submitted this change and it was merged.
Change subject: SpecialGWTooset clean-up & fix
......................................................................
SpecialGWTooset clean-up & fix
* added 'allow-get' key to $_registered_modules and logic to determine
the action to take when a module allows a get request or not
* added missing $this->outputHeader();
* removed extra $this->setHeaders();
* removed @return {void} comment
Change-Id: If571b9be56a2670616fe5d03642e6d5b621b7dbb
---
M includes/Specials/SpecialGWToolset.php
1 file changed, 12 insertions(+), 5 deletions(-)
Approvals:
BryanDavis: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Specials/SpecialGWToolset.php
b/includes/Specials/SpecialGWToolset.php
index 93aa3a4..33c45cf 100644
--- a/includes/Specials/SpecialGWToolset.php
+++ b/includes/Specials/SpecialGWToolset.php
@@ -36,15 +36,23 @@
*/
protected $_registered_modules = array(
'metadata-detect' => array(
+ 'allow-get' => true,
'handler' =>
'\GWToolset\Handlers\Forms\MetadataDetectHandler',
'form' => '\GWToolset\Forms\MetadataDetectForm'
),
'metadata-mapping' => array(
+ 'allow-get' => false,
'handler' =>
'\GWToolset\Handlers\Forms\MetadataMappingHandler',
'form' => '\GWToolset\Forms\MetadataMappingForm'
),
'metadata-mapping-save' => array(
+ 'allow-get' => false,
'handler' =>
'\GWToolset\Handlers\Ajax\MetadataMappingSaveHandler'
+ ),
+ 'metadata-preview' => array(
+ 'allow-get' => false,
+ 'handler' =>
'\GWToolset\Handlers\Forms\MetadataMappingHandler',
+ 'form' => '\GWToolset\Forms\MetadataMappingForm'
)
);
@@ -62,6 +70,7 @@
*/
public function execute( $par ) {
$this->setHeaders();
+ $this->outputHeader();
set_error_handler( '\GWToolset\handleError' );
if ( $this->wikiChecks() ) {
@@ -95,7 +104,9 @@
$html = null;
if ( !$this->getRequest()->wasPosted() ) {
- if ( $this->module_key === null ) {
+ if ( $this->module_key === null
+ ||
!$this->_registered_modules[$this->module_key]['allow-get']
+ ) {
$html .= wfMessage( 'gwtoolset-intro'
)->parseAsBlock();
} else {
try {
@@ -158,7 +169,6 @@
}
}
- $this->setHeaders();
$this->getOutput()->addModules( 'ext.GWToolset' );
$this->getOutput()->addHtml(
wfMessage( 'gwtoolset-menu' )->rawParams(
@@ -173,9 +183,6 @@
$this->getOutput()->addHtml( $html );
}
- /**
- * @return {void}
- */
protected function setModuleAndHandler() {
$this->module_key = null;
$gwtoolset_form = $this->getRequest()->getVal( 'gwtoolset-form'
);
--
To view, visit https://gerrit.wikimedia.org/r/92171
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If571b9be56a2670616fe5d03642e6d5b621b7dbb
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Dan-nl <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits