r83967 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83966‎ | r83967 | r83968 >
Date:21:17, 14 March 2011
Author:yaron
Status:deferred
Tags:
Comment:
Fixed display of form title when form is disabled
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_FormEdit.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php
@@ -88,12 +88,6 @@
8989
9090 if ( $target_name != '' ) {
9191 $target_title = Title::newFromText( $target_name );
92 - if ( $target_title->exists() ) {
93 - $s = wfMsg( 'sf_formedit_edittitle', $form_title->getText(), $target_title->getPrefixedText() );
94 - } else {
95 - $s = wfMsg( 'sf_formedit_createtitle', $form_title->getText(), $target_title->getPrefixedText() );
96 - }
97 - $wgOut->setPageTitle( $s );
9892 }
9993
10094 // handling is different depending on whether or not page
@@ -150,6 +144,18 @@
151145 }
152146 list ( $form_text, $javascript_text, $data_text, $form_page_title, $generated_page_name ) =
153147 $sfgFormPrinter->formHTML( $form_definition, $form_submitted, $page_is_source, $form_article->getID(), $page_contents, $target_name, $page_name_formula );
 148+
 149+ // Before we do anything else, set the form header
 150+ // title - this needs to be done after formHTML() is
 151+ // called, because otherwise it doesn't take hold
 152+ // for some reason if the form is disabled.
 153+ if ( $target_title->exists() ) {
 154+ $s = wfMsg( 'sf_formedit_edittitle', $form_title->getText(), $target_title->getPrefixedText() );
 155+ } else {
 156+ $s = wfMsg( 'sf_formedit_createtitle', $form_title->getText(), $target_title->getPrefixedText() );
 157+ }
 158+ $wgOut->setPageTitle( $s );
 159+
154160 if ( $form_submitted ) {
155161 if ( $page_name_formula != '' ) {
156162 $target_name = $generated_page_name;

Follow-up revisions

RevisionCommit summaryAuthorDate
r84065Fixed setting of form title for forms with no target page (broken in r83967);...yaron22:56, 15 March 2011