jenkins-bot has submitted this change and it was merged.

Change subject: Set initial page to Step 1: Metadata detection
......................................................................


Set initial page to Step 1: Metadata detection

* adjusted i18n message
* adjusted links
* adjusted logic

Bug: 64285
Change-Id: I4871a421746995433f07a3d2e2e41f13c15af8c9
---
M i18n/en.json
M includes/Forms/MetadataDetectForm.php
M includes/Forms/PreviewForm.php
M includes/Specials/SpecialGWToolset.php
4 files changed, 37 insertions(+), 29 deletions(-)

Approvals:
  MarkTraceur: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 3a6258b..cef1bf5 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -10,13 +10,13 @@
        },
        "gwtoolset": "GWToolset",
        "gwtoolset-desc": "GWToolset, a mass upload tool for GLAMs",
-       "gwtoolset-intro": "GWToolset is a MediaWiki extension that allows 
GLAMs (Galleries, Libraries, Archives and Museums) the ability to mass upload 
content based on an XML file containing respective metadata about the content. 
The intent is to allow for a variety of XML schemas. Further information about 
the project can be found on its 
[https://commons.wikimedia.org/wiki/Commons:GLAMToolset_project project page]. 
Feel free to contact us on that page as well. Select one of the menu items 
above to begin the upload process.",
+       "gwtoolset-intro": "GWToolset is a MediaWiki extension that allows 
GLAMs (Galleries, Libraries, Archives and Museums) the ability to mass upload 
content based on an XML file containing respective metadata about the content. 
Further information about the project can be found on its 
[[commons:Commons:GLAMToolset_project|project page]].",
        "right-gwtoolset": "Use GWToolset",
        "action-gwtoolset": "use GWToolset",
        "group-gwtoolset": "GWToolset users",
        "group-gwtoolset-member": "{{GENDER:$1|GWToolset user}}",
        "grouppage-gwtoolset": "{{ns:project}}:GWToolset users",
-       "gwtoolset-back-to-top": "⇪ top of the page",
+       "gwtoolset-back-to-top": "top of the page",
        "gwtoolset-batchjob-creation-failure": "Could not create a batch job of 
type \"$1\".",
        "gwtoolset-could-not-close-xml": "Could not close the XML reader.",
        "gwtoolset-could-not-open-xml": "Could not open the XML file for 
reading.",
diff --git a/includes/Forms/MetadataDetectForm.php 
b/includes/Forms/MetadataDetectForm.php
index dab7257..9636542 100644
--- a/includes/Forms/MetadataDetectForm.php
+++ b/includes/Forms/MetadataDetectForm.php
@@ -74,6 +74,12 @@
 
                return
                        Html::rawElement(
+                               'p',
+                               array(),
+                               wfMessage( 'gwtoolset-intro' )->parse()
+                       ) .
+
+                       Html::rawElement(
                                'h2',
                                array(),
                                wfMessage( 'gwtoolset-step-1-heading' 
)->escaped()
diff --git a/includes/Forms/PreviewForm.php b/includes/Forms/PreviewForm.php
index 5287575..b1e6a5b 100644
--- a/includes/Forms/PreviewForm.php
+++ b/includes/Forms/PreviewForm.php
@@ -51,14 +51,19 @@
                                ) .
                                Html::rawElement( 'br' );
 
-               $step1_link = Html::rawElement( 'li', array(), Linker::link(
-                       Title::newFromText( 'Special:GWToolset' ),
-                       wfMessage( 'gwtoolset-step-1-heading' )->escaped(),
+               $step1_link = Html::rawElement(
+                       'li',
                        array(),
-                       array( 'gwtoolset-form' => 'metadata-detect' )
-               ) );
+                       Linker::link(
+                               Title::newFromText( 'Special:GWToolset' ),
+                               wfMessage( 'gwtoolset-step-1-heading' 
)->escaped(),
+                               array()
+                       )
+               );
 
-               $step2_link = Html::rawElement( 'li', array(),
+               $step2_link = Html::rawElement(
+                       'li',
+                       array(),
                        Html::rawElement( 'span', array( 'id' =>'step2-link' ), 
' ' )
                );
 
diff --git a/includes/Specials/SpecialGWToolset.php 
b/includes/Specials/SpecialGWToolset.php
index 974c450..c5b60a4 100644
--- a/includes/Specials/SpecialGWToolset.php
+++ b/includes/Specials/SpecialGWToolset.php
@@ -98,28 +98,20 @@
        /**
         * a control method that processes a SpecialPage request
         * SpecialPage->getOutput()->addHtml() present the end result of the 
request
-        *
-        * @throws {GWTException|MWException|PermissionsError}
         */
        protected function processRequest() {
-               $html = null;
+               $html = '';
 
                if ( !$this->getRequest()->wasPosted() ) {
-                       if ( $this->module_key === null
-                               || 
!$this->_registered_modules[$this->module_key]['allow-get']
-                       ) {
-                               $html .= wfMessage( 'gwtoolset-intro' 
)->parseAsBlock();
-                       } else {
-                               try {
-                                       $html .= $this->_Handler->getHtmlForm( 
$this->module_key );
-                               } catch ( GWTException $e ) {
-                                       $html .=
-                                               Html::rawElement(
-                                                       'h2', array(),
-                                                       wfMessage( 
'gwtoolset-technical-error' )->escaped()
-                                               ) .
-                                               Html::rawElement( 'p', array( 
'class' => 'error' ), $e->getMessage() );
-                               }
+                       try {
+                               $html .= $this->_Handler->getHtmlForm( 
$this->module_key );
+                       } catch ( GWTException $e ) {
+                               $html .=
+                                       Html::rawElement(
+                                               'h2', array(),
+                                               wfMessage( 
'gwtoolset-technical-error' )->escaped()
+                                       ) .
+                                       Html::rawElement( 'p', array( 'class' 
=> 'error' ), $e->getMessage() );
                        }
                } else {
                        try {
@@ -136,16 +128,17 @@
                }
 
                $this->getOutput()->addModules( 'ext.GWToolset' );
+
                $this->getOutput()->addHtml(
                        wfMessage( 'gwtoolset-menu' )->rawParams(
                                Linker::link(
                                        Title::newFromText( 'Special:' . 
Constants::EXTENSION_NAME ),
                                        wfMessage( 'gwtoolset-menu-1' 
)->escaped(),
-                                       array(),
-                                       array( 'gwtoolset-form' => 
'metadata-detect' )
+                                       array()
                                )
                        )->parse()
                );
+
                $this->getOutput()->addHtml( $html );
        }
 
@@ -154,7 +147,11 @@
         */
        protected function setModuleAndHandler() {
                $this->module_key = null;
-               $gwtoolset_form = $this->getRequest()->getVal( 'gwtoolset-form' 
);
+
+               $gwtoolset_form =
+                       $this->getRequest()->getVal( 'gwtoolset-form' )
+                       ? $this->getRequest()->getVal( 'gwtoolset-form' )
+                       : 'metadata-detect';
 
                if ( array_key_exists( $gwtoolset_form, 
$this->_registered_modules ) ) {
                        $this->module_key = $gwtoolset_form;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4871a421746995433f07a3d2e2e41f13c15af8c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Dan-nl <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[email protected]>
Gerrit-Reviewer: Gilles <[email protected]>
Gerrit-Reviewer: Kelson <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to