r108489 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108488‎ | r108489 | r108490 >
Date:03:05, 10 January 2012
Author:laner
Status:ok
Tags:
Comment:
Only edit the SAL if it doesn't have the template text. Fixes bug 33619.
Modified paths:
  • /trunk/extensions/OpenStackManager/OpenStackNovaProject.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/OpenStackNovaProject.php
@@ -345,8 +345,16 @@
346346 OpenStackNovaArticle::editArticle( $this->getProjectName(), $text );
347347 if ( $wgOpenStackManagerCreateProjectSALPages ) {
348348 $pagename = $this->getProjectName() . "/SAL";
 349+ $id = Title::newFromText( $pagename, NS_NOVA_RESOURCE )->getArticleId();
 350+ $article = Article::newFromId( $id );
 351+ $content = '';
 352+ if ( $article ) {
 353+ $content = $article->getRawText();
 354+ }
349355 $text = "{{SAL|Project Name=" . $this->getProjectName() . "}}";
350 - OpenStackNovaArticle::editArticle( $pagename, $text );
 356+ if ( !strstr( $content, $text ) ) {
 357+ OpenStackNovaArticle::editArticle( $pagename, $text );
 358+ }
351359 }
352360 }
353361

Status & tagging log