Skip to content

Commit

Permalink
[#477 state:resolved] Fixed bug resulting from save a new blog for wh…
Browse files Browse the repository at this point in the history
…ich max revisions preferences should not be validated.
  • Loading branch information
jayallen committed Nov 2, 2010
1 parent 73139fc commit 09c7bd5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/MT/CMS/Blog.pm
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ sub save {
$obj->nofollow_urls(1);
$obj->follow_auth_links(1);
$obj->page_layout('layout-wtt');
$obj->max_revisions_entry($MT::Revisable::MAX_REVISIONS);
$obj->max_revisions_template($MT::Revisable::MAX_REVISIONS);
my @authenticators = qw( MovableType );
foreach my $auth (qw( Vox LiveJournal )) {
my $a = MT->commenter_authenticator($auth);
Expand Down Expand Up @@ -1851,10 +1853,15 @@ sub save_filter {
if $app->param('archive_path') =~ m/^\s*$/
&& $app->param('enable_archive_paths');

return $eh->error( MT->translate("The number of revisions to store must be a positive integer.") )
unless 0 < sprintf('%d', $app->param('max_revisions_entry'));
return $eh->error( MT->translate("The number of revisions to store must be a positive integer.") )
unless 0 < sprintf('%d', $app->param('max_revisions_template'));
return 1 unless $q->param('id');

# Only for existing blogs....
my $err = 'The number of revisions to store must be a positive integer.';
foreach my $type (qw( entry template )) {
warn $app->param('max_revisions_'.$type );
return $eh->error( MT->translate($err) )
unless int( $app->param('max_revisions_'.$type )) > 0;
}

return 1;
}
Expand Down

0 comments on commit 09c7bd5

Please sign in to comment.