--- lib/MT/Comment.pm.orig Sat May 17 23:17:47 2003 +++ lib/MT/Comment.pm Sun May 18 00:36:50 2003 @@ -10,7 +10,7 @@ @MT::Comment::ISA = qw( MT::Object ); __PACKAGE__->install_properties({ columns => [ - 'id', 'blog_id', 'entry_id', 'author', 'email', 'url', 'text', 'ip' + 'id', 'blog_id', 'entry_id', 'author', 'email', 'url', 'text', 'ip', 'convert_breaks' ], indexes => { created_on => 1, --- lib/MT/App/Comments.pm.orig Sun May 18 00:44:55 2003 +++ lib/MT/App/Comments.pm Mon May 19 11:17:22 2003 @@ -101,6 +101,7 @@ "Invalid URL '[_1]'", $url)); } } + $comment->convert_breaks($q->param('convert_breaks')); $comment->url(remove_html($url)); $comment->text($q->param('text')); $comment->save; @@ -187,6 +188,7 @@ EntryIfCommentsOpen => $entry->allow_comments eq '1', EntryIfAllowPings => $entry->allow_pings, ); + $ctx->stash('convert_breaks', $q->param('convert_breaks')); my $tmpl = MT::Template->load({ type => 'comments', blog_id => $entry->blog_id }) or return $app->error($app->translate( @@ -216,8 +218,8 @@ my $ctx = MT::Template::Context->new; my $comment = MT::Comment->new; $comment->blog_id($entry->blog_id); - for my $f (qw( entry_id author email url text )) { - $comment->$f(scalar $q->param($f)); + for my $f (qw( entry_id author email url text convert_breaks )) { + $comment->$f($q->param($f) ? scalar $q->param($f) : " "); } $comment->ip($app->remote_ip); ## Set timestamp as we would usually do in ObjectDriver. --- lib/MT/Template/Context.pm.orig Sat May 17 23:02:47 2003 +++ lib/MT/Template/Context.pm Mon May 19 09:04:57 2003 @@ -1168,11 +1168,14 @@ my $blog = $ctx->stash('blog'); my $t = defined $c->text ? $c->text : ''; $t = munge_comment($t, $blog); + my $filter = defined $c->convert_breaks ? + [$c->convert_breaks] : + $blog->comment_text_filters; my $convert_breaks = exists $arg->{convert_breaks} ? $arg->{convert_breaks} : $blog->convert_paras_comments; return $convert_breaks ? - MT->apply_text_filters($t, $blog->comment_text_filters, $ctx) : + MT->apply_text_filters($t, $filter, $ctx) : $t; } sub _hdlr_comment_order_num { $_[0]->stash('comment_order_num') }