Yaron Koren has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/308763

Change subject: Fix for maintaining session in upload window - patch by Peter 
Grassberger
......................................................................

Fix for maintaining session in upload window - patch by Peter Grassberger

Change-Id: I2bdd26e04a6a90c6b25f0749b9935a562c828798
---
M specials/SF_UploadWindow.php
1 file changed, 10 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/63/308763/2

diff --git a/specials/SF_UploadWindow.php b/specials/SF_UploadWindow.php
index 9f3800d..50fbeba 100644
--- a/specials/SF_UploadWindow.php
+++ b/specials/SF_UploadWindow.php
@@ -27,6 +27,7 @@
        /** Misc variables **/
        public $mRequest;                       // The WebRequest or 
FauxRequest this form is supposed to handle
        public $mSourceType;
+       /** @var UploadBase */
        public $mUpload;
        public $mLocalFile;
        public $mUploadClicked;
@@ -164,11 +165,9 @@
        }
 
        /**
-        * Show the main upload form and optionally add the session key to the
-        * output. This hides the source selection.
+        * Show the main upload form.
         *
-        * @param string $message HTML message to be shown at top of form
-        * @param string $sessionKey Session key of the stashed upload
+        * @param UploadForm $form
         */
        protected function showUploadForm( $form ) {
                # Add links if file was previously deleted
@@ -253,7 +252,7 @@
         * @param string $message HTML message to be passed to mainUploadForm
         */
        protected function recoverableUploadError( $message ) {
-               $sessionKey = $this->mUpload->stashSession();
+               $sessionKey = $this->mUpload->stashFile()->getFileKey();
                $message = '<h2>' . wfMessage( 'uploadwarning' )->escaped() . 
"</h2>\n" .
                        '<div class="error">' . $message . "</div>\n";
                
@@ -267,7 +266,7 @@
         * @param array $warnings
         */
        protected function uploadWarning( $warnings ) {
-               $sessionKey = $this->mUpload->stashSession();
+               $sessionKey = $this->mUpload->stashFile()->getFileKey();
 
                $warningHtml = '<h2>' . wfMessage( 'uploadwarning' )->escaped() 
. "</h2>\n"
                        . '<ul class="warning">';
@@ -491,6 +490,7 @@
         * Provides output to the user for a result of UploadBase::verifyUpload
         *
         * @param array $details Result of UploadBase::verifyUpload
+        * @throws MWException
         */
        protected function processVerificationError( $details ) {
                global $wgFileExtensions;
@@ -743,11 +743,13 @@
        protected function getSourceSection() {
                if ( $this->mSessionKey ) {
                        return array(
-                               'wpSessionKey' => array(
+                               'SessionKey' => array(
+                                       'id' => 'wpSessionKey',
                                        'type' => 'hidden',
                                        'default' => $this->mSessionKey,
                                ),
-                               'wpSourceType' => array(
+                               'SourceType' => array(
+                                       'id' => 'wpSourceType',
                                        'type' => 'hidden',
                                        'default' => 'Stash',
                                ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2bdd26e04a6a90c6b25f0749b9935a562c828798
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to