Merge "Instruct stashed upload failures to reupload file"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 14 Sep 2017 19:46:49 +0000 (19:46 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 14 Sep 2017 19:46:49 +0000 (19:46 +0000)
includes/specials/SpecialUpload.php
languages/i18n/en.json
languages/i18n/qqq.json

index 59f9796..024034a 100644 (file)
@@ -344,15 +344,16 @@ class SpecialUpload extends SpecialPage {
                $stashStatus = $this->mUpload->tryStashFile( $this->getUser() );
                if ( $stashStatus->isGood() ) {
                        $sessionKey = $stashStatus->getValue()->getFileKey();
+                       $uploadWarning = 'upload-tryagain';
                } else {
                        $sessionKey = null;
-                       // TODO Add a warning message about the failure to stash here?
+                       $uploadWarning = 'upload-tryagain-nostash';
                }
                $message = '<h2>' . $this->msg( 'uploaderror' )->escaped() . "</h2>\n" .
                        '<div class="error">' . $message . "</div>\n";
 
                $form = $this->getUploadForm( $message, $sessionKey );
-               $form->setSubmitText( $this->msg( 'upload-tryagain' )->escaped() );
+               $form->setSubmitText( $this->msg( $uploadWarning )->escaped() );
                $this->showUploadForm( $form );
        }
 
@@ -379,9 +380,10 @@ class SpecialUpload extends SpecialPage {
                $stashStatus = $this->mUpload->tryStashFile( $this->getUser() );
                if ( $stashStatus->isGood() ) {
                        $sessionKey = $stashStatus->getValue()->getFileKey();
+                       $uploadWarning = 'uploadwarning-text';
                } else {
                        $sessionKey = null;
-                       // TODO Add a warning message about the failure to stash here?
+                       $uploadWarning = 'uploadwarning-text-nostash';
                }
 
                // Add styles for the warning, reused from the live preview
@@ -443,7 +445,7 @@ class SpecialUpload extends SpecialPage {
                        $warningHtml .= $msg;
                }
                $warningHtml .= "</ul></div>\n";
-               $warningHtml .= $this->msg( 'uploadwarning-text' )->parseAsBlock();
+               $warningHtml .= $this->msg( $uploadWarning )->parseAsBlock();
 
                $form = $this->getUploadForm( $warningHtml, $sessionKey, /* $hideIgnoreWarning */ true );
                $form->setSubmitText( $this->msg( 'upload-tryagain' )->text() );
index 24e1818..1a0f6a6 100644 (file)
        "uploadbtn": "Upload file",
        "reuploaddesc": "Cancel upload and return to the upload form",
        "upload-tryagain": "Submit modified file description",
+       "upload-tryagain-nostash": "Submit re-uploaded file and modified description",
        "uploadnologin": "Not logged in",
        "uploadnologintext": "Please $1 to upload files.",
        "upload_directory_missing": "The upload directory ($1) is missing and could not be created by the webserver.",
        "file-deleted-duplicate-notitle": "A file identical to this file has previously been deleted, and the title has been suppressed.\nYou should ask someone with the ability to view suppressed file data to review the situation before proceeding to re-upload it.",
        "uploadwarning": "Upload warning",
        "uploadwarning-text": "Please modify the file description below and try again.",
+       "uploadwarning-text-nostash": "Please re-upload the file, modify the description below and try again.",
        "savefile": "Save file",
        "uploadedimage": "uploaded \"[[$1]]\"",
        "overwroteimage": "uploaded a new version of \"[[$1]]\"",
index 208c7c3..607e5c3 100644 (file)
        "uploadbtn": "Button name in [[Special:Upload]].\n\nSee also:\n* {{msg-mw|Uploadbtn}}\n* {{msg-mw|Accesskey-upload}}\n* {{msg-mw|Tooltip-upload}}\n{{Identical|Upload file}}",
        "reuploaddesc": "Used as button text in the Upload form on [[Special:Upload]].\n\nSee also:\n* {{msg-mw|upload-tryagain|Submit button text}}\n* {{msg-mw|ignorewarning|button text}}",
        "upload-tryagain": "Used as Submit button text in [[Special:Upload]].\n\nSee also:\n* {{msg-mw|Uploaderror|section header}}\n* {{msg-mw|ignorewarning|button text}}\n* {{msg-mw|reuploaddesc|button text}}",
+       "upload-tryagain-nostash": "Used as Submit button text in [[Special:Upload]] when the upload could not be stashed & the file needs to be reuploaded.\n\nSee also:\n* {{msg-mw|Uploaderror|section header}}\n* {{msg-mw|ignorewarning|button text}}\n* {{msg-mw|reuploaddesc|button text}}",
        "uploadnologin": "Used as title of the error message {{msg-mw|Uploadnologintext}}.\n{{Identical|Not logged in}}",
        "uploadnologintext": "Used as error message.\n\nThe title for this message is {{msg-mw|Uploadnologin}}.\n\nParameters:\n* $1 - link text {{msg-mw|Loginreqlink}}. The link points to [[Special:UserLogin]].\nSee also:\n* {{msg-mw|Whitelistedittext}}\n* {{msg-mw|Nocreatetext}}\n* {{msg-mw|Loginreqpagetext}}",
        "upload_directory_missing": "Parameters:\n* $1 - directory name",
        "file-deleted-duplicate-notitle": "Used in [[Special:Upload]] when the title of the deleted duplicate is not available.\n\nSee also:\n* {{msg-mw|file-deleted-duplicate}}",
        "uploadwarning": "Used as section header in [[Special:Upload]].",
        "uploadwarning-text": "Used in [[Special:Upload]].",
+       "uploadwarning-text-nostash": "Used in [[Special:Upload]], when the upload could not be stashed & the file needs to be reuploaded.",
        "savefile": "When uploading a file",
        "uploadedimage": "{{ignored}}This is a ''logentry'' message only used on IRC. $1 is the name of the file uploaded.",
        "overwroteimage": "{{ignored}}This is a ''logentry'' message only used on IRC. $1 is the name of the file uploaded.",