r91021 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91020‎ | r91021 | r91022 >
Date:21:59, 28 June 2011
Author:yaron
Status:deferred (Comments)
Tags:
Comment:
Removed setting of hidden field for 'title' value - no longer necessary (?), and it caused problems in wikis in certain languages - perhaps all languages where the translation of the "Special" namespace contains non-Latin characters
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_CreateForm.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php
@@ -78,7 +78,7 @@
7979 success: function(data){
8080 inputParamsDiv.html(data);
8181 }
82 - });
 82+ });
8383 };
8484 jQuery(document).ready(function() {
8585 jQuery('.inputTypeSelector').change( function() {
@@ -218,10 +218,6 @@
219219 }
220220
221221 $text = ' <form action="" method="post">' . "\n";
222 -
223 - // Set 'title' field, in case there's no URL niceness.
224 - $cf = Title::makeTitleSafe( NS_SPECIAL, 'CreateForm' );
225 - $text .= "\t" . Html::Hidden( 'title', SFUtils::titleURLString( $cf ) ) . "\n";
226222 $text .= ' <p>' . wfMsg( 'sf_createform_nameinput' ) . ' ' . wfMsg( 'sf_createform_nameinputdesc' ) . ' <input size=25 name="form_name" value="' . $form_name . '">';
227223 if ( ! empty( $form_name_error_str ) )
228224 $text .= ' ' . Xml::element( 'font', array( 'color' => 'red' ), $form_name_error_str );
Index: trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php
@@ -192,10 +192,6 @@
193193 }
194194
195195 $text .= ' <form id="createTemplateForm" action="" method="post">' . "\n";
196 -
197 - // Set 'title' field, in case there's no URL niceness
198 - $ct = Title::makeTitleSafe( NS_SPECIAL, 'CreateTemplate' );
199 - $text .= "\t" . Html::hidden( 'title', SFUtils::titleURLString( $ct ) ) . "\n";
200196 $text .= "\t<p id=\"template_name_p\">" . wfMsg( 'sf_createtemplate_namelabel' ) . ' <input size="25" id="template_name" name="template_name" /></p>' . "\n";
201197 $text .= "\t<p>" . wfMsg( 'sf_createtemplate_categorylabel' ) . ' <input size="25" name="category" /></p>' . "\n";
202198 $text .= "\t<fieldset>\n";

Follow-up revisions

RevisionCommit summaryAuthorDate
r91050Follow-up to r91021 - re-added setting of title as hidden field, this time co...yaron04:14, 29 June 2011

Comments

#Comment by Nikerabbit (talk | contribs)   22:36, 28 June 2011

Are you sure this wont break it for people with index.php-style urls?

The normal way to do this is

Html::hidden( 'title', $this->getTitle()->getPrefixedText() );
#Comment by Yaron Koren (talk | contribs)   04:16, 29 June 2011

Thanks! Somehow, your suggested code works while mine failed. I added it in, in r91050.