r73504 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73503‎ | r73504 | r73505 >
Date:01:01, 22 September 2010
Author:yaron
Status:deferred
Tags:
Comment:
Fix for pages with an embedded 'RunQuery', so that their actual title is displayed and not a dummy 'testing' title
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
@@ -189,11 +189,18 @@
190190 // set in different ways
191191 // HACK - sometimes we don't know the page name in advance, but we still
192192 // need to set a title here for testing permissions
193 - if ( $page_name == '' )
 193+ if ( $embedded ) {
 194+ // if this is an embedded form (probably a 'RunQuery'), just use the
 195+ // name of the actual page we're on
 196+ global $wgTitle;
 197+ $this->mPageTitle = $wgTitle;
 198+ } elseif ( $page_name == '' ) {
194199 $this->mPageTitle = Title::newFromText(
195200 $wgRequest->getVal( 'namespace' ) . ":Semantic Forms permissions test" );
196 - else
 201+ } else {
197202 $this->mPageTitle = Title::newFromText( $page_name );
 203+ }
 204+
198205 global $wgOut;
199206 // show previous set of deletions for this page, if it's been deleted before
200207 if ( ! $form_submitted && ! $this->mPageTitle->exists() ) {

Status & tagging log