Merge "mw.ForeignStructuredUpload: Prevent categories and descriptions from being...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 5 Nov 2015 19:00:47 +0000 (19:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 5 Nov 2015 19:00:47 +0000 (19:00 +0000)
resources/src/mediawiki/mediawiki.ForeignStructuredUpload.BookletLayout.js
resources/src/mediawiki/mediawiki.ForeignStructuredUpload.js

index 717e2ec..8595386 100644 (file)
         */
        mw.ForeignStructuredUpload.BookletLayout.prototype.getText = function () {
                var language = mw.config.get( 'wgContentLanguage' );
+               this.upload.clearDescriptions();
                this.upload.addDescription( language, this.descriptionWidget.getValue() );
                this.upload.setDate( this.dateWidget.getValue() );
+               this.upload.clearCategories();
                this.upload.addCategories( this.categoriesWidget.getItemsData() );
                return this.upload.getText();
        };
index 1471e46..8d2f753 100644 (file)
                }
        };
 
+       /**
+        * Empty the list of categories for the upload.
+        */
+       ForeignStructuredUpload.prototype.clearCategories = function () {
+               this.categories = [];
+       };
+
        /**
         * Add a description to the upload.
         *
                } );
        };
 
+       /**
+        * Empty the list of descriptions for the upload.
+        */
+       ForeignStructuredUpload.prototype.clearDescriptions = function () {
+               this.descriptions = [];
+       };
+
        /**
         * Set the date of creation for the upload.
         *