r95742 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95741‎ | r95742 | r95743 >
Date:08:56, 30 August 2011
Author:nikerabbit
Status:deferred
Tags:
Comment:
Small fixes, avoid oldid bugs, whitespace
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_FormEdit.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_FormStart.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_RunQuery.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_Templates.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php
@@ -88,7 +88,7 @@
8989 }
9090 }
9191
92 - if ( ( ! $form_title || ! $form_title->exists() ) && ( $form_name != '' ) ) {
 92+ if ( ( !$form_title || !$form_title->exists() ) && ( $form_name != '' ) ) {
9393 $text = Xml::element( 'p', null, wfMsg( 'sf_formstart_badform', SFUtils::linkText( SF_NS_FORM, $form_name ) ) ) . "\n";
9494 } else {
9595 if ( $form_name == '' ) {
@@ -126,7 +126,7 @@
127127 if ( $page_title->exists() ) {
128128 // It exists - see if page is a redirect; if
129129 // it is, edit the target page instead.
130 - $article = new Article( $page_title );
 130+ $article = new Article( $page_title, 0 );
131131 $article->loadContent();
132132 $redirect_title = Title::newFromRedirect( $article->fetchContent() );
133133 if ( $redirect_title != null ) {
Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php
@@ -103,7 +103,7 @@
104104
105105 $form_title = Title::makeTitleSafe( SF_NS_FORM, $form_name );
106106
107 - $form_article = new Article( $form_title );
 107+ $form_article = new Article( $form_title, 0 );
108108 $form_definition = $form_article->getContent();
109109 $form_definition = StringUtils::delimiterReplace( '<noinclude>', '</noinclude>', '', $form_definition );
110110
@@ -125,7 +125,7 @@
126126 $page_contents = null;
127127 //$page_is_source = false;
128128 } else {
129 - $target_article = new Article( $target_title );
 129+ $target_article = new Article( $target_title, 0 );
130130 $page_contents = $target_article->getContent();
131131 //$page_is_source = true;
132132 }
@@ -300,7 +300,7 @@
301301
302302 // Find existing article if it exists,
303303 // or create a new one.
304 - $article = new Article( $target_title );
 304+ $article = new Article( $target_title, 0 );
305305
306306 $editor = new EditPage( $article );
307307 $editor->importFormData( $request );
Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php
@@ -35,10 +35,11 @@
3636 // Get contents of form-definition page.
3737 $form_title = Title::makeTitleSafe( SF_NS_FORM, $form_name );
3838
39 - if ( ! $form_title || ! $form_title->exists() ) {
 39+ if ( !$form_title || !$form_title->exists() ) {
4040 if ( $form_name == '' ) {
4141 $text = Xml::element( 'p', array( 'class' => 'error' ), wfMsg( 'sf_runquery_badurl' ) ) . "\n";
4242 } else {
 43+ /// FIXME: i18n
4344 $text = '<p class="error">Error: No form page was found at ' . SFUtils::linkText( SF_NS_FORM, $form_name ) . ".</p>\n";
4445 }
4546 $wgOut->addHTML( $text );
@@ -46,7 +47,7 @@
4748 }
4849
4950 // Initialize variables.
50 - $form_article = new Article( $form_title );
 51+ $form_article = new Article( $form_title, 0 );
5152 $form_definition = $form_article->getContent();
5253 $submit_url = $form_title->getLocalURL( 'action=submit' );
5354 if ( $embedded ) {
@@ -110,7 +111,7 @@
111112 $text .= "\n<h2>$additional_query</h2>\n";
112113 }
113114 if ( !$raw ) {
114 - $action = htmlspecialchars( SpecialPage::getTitleFor( "RunQuery", $form_name )->getLocalURL() );
 115+ $action = htmlspecialchars( $this->getTitle( $form_name )->getLocalURL() );
115116 $text .= <<<END
116117 <form id="sfForm" name="createbox" action="$action" method="post" class="createbox">
117118
Index: trunk/extensions/SemanticForms/specials/SF_Templates.php
@@ -97,7 +97,7 @@
9898 function getCategoryDefinedByTemplate( $templateTitle ) {
9999 global $wgContLang;
100100
101 - $templateArticle = new Article( $templateTitle );
 101+ $templateArticle = new Article( $templateTitle, 0 );
102102 $templateText = $templateArticle->getContent();
103103 $cat_ns_name = $wgContLang->getNsText( NS_TEMPLATE );
104104 if ( preg_match_all( "/\[\[(Category|$cat_ns_name):([^\]]*)\]\]/", $templateText, $matches ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r96080Follow-up to r95742 - changes didn't work correctly because printPage() was a...yaron04:40, 2 September 2011