r89967 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89966‎ | r89967 | r89968 >
Date:14:39, 13 June 2011
Author:wikinaut
Status:ok
Tags:
Comment:
when adding a new thread with an empty text body, a placeholder default text is added with an action=edit link
Modified paths:
  • /trunk/extensions/LiquidThreads/api/ApiThreadAction.php (modified) (history)
  • /trunk/extensions/LiquidThreads/i18n/Lqt.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/i18n/Lqt.i18n.php
@@ -295,7 +295,7 @@
296296
297297 // Automatic summaries
298298 'lqt-newpost-summary' => 'New thread: $1',
299 - 'lqt-newpost-defaultbody-user-submitted-empty-textbody' => "<!-- thread subject $1 -->''Please enter your text for this thread. You should delete this line then.''",
 299+ 'lqt-newpost-defaultbody-user-submitted-empty-textbody' => "Please enter your text for this thread. You should delete this line then.",
300300 'lqt-reply-summary' => 'Reply to [[$2|$1]]',
301301
302302 // Talk page history
Index: trunk/extensions/LiquidThreads/api/ApiThreadAction.php
@@ -263,8 +263,9 @@
264264 // Check for text
265265 if ( empty( $params['text'] ) ) {
266266 // $this->dieUsage( 'You must include text in your post', 'no-text' );
267 - // FIXME: add an "edit post" link as second parameter $2 to the text
268 - $params['text'] = wfMsgForContent( 'lqt-newpost-defaultbody-user-submitted-empty-textbody', $subject ) ;
 267+ // creating a thread with a body dummy rendered as "edit" link for itself
 268+ $defaultBody = wfMsgForContent( 'lqt-newpost-defaultbody-user-submitted-empty-textbody', $subject ) ;
 269+ $params['text'] = "''[{{fullurl:{{FULLPAGENAMEE}}|action=edit}} $defaultBody]''";
269270 }
270271 $text = $params['text'];
271272

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89958fix for bug29200 - Creation of new thread fails silently if no content is ent...wikinaut12:58, 13 June 2011

Status & tagging log