Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php |
— | — | @@ -198,14 +198,6 @@ |
199 | 199 | $this->addNotice( $noticeName, '0', $start, $project_name, $project_languages ); |
200 | 200 | } |
201 | 201 | } |
202 | | - |
203 | | - // Handle weight change |
204 | | - $updatedWeights = $wgRequest->getArray( 'weight' ); |
205 | | - if ( isset( $updatedWeights ) ) { |
206 | | - foreach ( $updatedWeights as $templateId => $weight ) { |
207 | | - $this->updateWeight( $noticeName, $templateId, $weight ); |
208 | | - } |
209 | | - } |
210 | 202 | |
211 | 203 | } else { |
212 | 204 | $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", 'sessionfailure' ); |
— | — | @@ -589,7 +581,7 @@ |
590 | 582 | |
591 | 583 | // Handle adding of banners to the campaign |
592 | 584 | $templatesToAdd = $wgRequest->getArray( 'addTemplates' ); |
593 | | - if ( isset( $templatesToAdd ) ) { |
| 585 | + if ( $templatesToAdd ) { |
594 | 586 | $weight = $wgRequest->getArray( 'weight' ); |
595 | 587 | foreach ( $templatesToAdd as $templateName ) { |
596 | 588 | $templateId = $this->getTemplateId( $templateName ); |
— | — | @@ -599,21 +591,29 @@ |
600 | 592 | |
601 | 593 | // Handle removing of banners from the campaign |
602 | 594 | $templateToRemove = $wgRequest->getArray( 'removeTemplates' ); |
603 | | - if ( isset( $templateToRemove ) ) { |
| 595 | + if ( $templateToRemove ) { |
604 | 596 | foreach ( $templateToRemove as $template ) { |
605 | 597 | $this->removeTemplateFor( $notice, $template ); |
606 | 598 | } |
607 | 599 | } |
| 600 | + |
| 601 | + // Handle weight changes |
| 602 | + $updatedWeights = $wgRequest->getArray( 'weight' ); |
| 603 | + if ( $updatedWeights ) { |
| 604 | + foreach ( $updatedWeights as $templateId => $weight ) { |
| 605 | + $this->updateWeight( $notice, $templateId, $weight ); |
| 606 | + } |
| 607 | + } |
608 | 608 | |
609 | 609 | // Handle new project name |
610 | 610 | $projectName = $wgRequest->getVal( 'project_name' ); |
611 | | - if ( isset( $projectName ) ) { |
| 611 | + if ( $projectName ) { |
612 | 612 | $this->updateProjectName ( $notice, $projectName ); |
613 | 613 | } |
614 | 614 | |
615 | 615 | // Handle new project languages |
616 | 616 | $projectLangs = $wgRequest->getArray( 'project_languages' ); |
617 | | - if ( isset( $projectLangs ) ) { |
| 617 | + if ( $projectLangs ) { |
618 | 618 | $this->updateProjectLanguages( $notice, $projectLangs ); |
619 | 619 | } |
620 | 620 | |