Basename Bug in MovableType 3.2

Recently, I encounter a problem when I use the “preview” function when I publish my entries. I guess you may have suffered this bug with MovableType 3.2 if you are also a newbie of MovableType. The problem is when an entry is saved from the Preview screen; the entry basename may be incremented or, if the title was changed, altered to fit the new title. And the other pages such as category page and index page will automatically change to the new entry’s permanent link.



However, the following step can fix the problem:
Open up MT_DIR/lib/MT/App/CMS.pm and find the following line:

$param{reedit} = 1 if $q->param('reedit');

replace it with the following:

if ($q->param('reedit')) {
$param{reedit} = 1;
if (!$q->param('basename_manual')) {
$param{'basename'} = '';
}
}

Then, search for the following lines around line 6045 in the same file:

for my $col (@$cols) {
next if $col eq 'created_on' || $col eq 'created_by' ||
$col eq 'modified_on' || $col eq 'modified_by' ||
$col eq 'author_id';

And directly after that section, add this:

if ($col eq 'basename') {
if ((!defined $q->param('basename')) ||
($q->param('basename') eq '')) {
$q->param('basename', $q->param('basename_old'));
}
}

Save the files and the bugs will be fixed.
Credit: I find this solution from Jay Allen’s Blog.

Leave a Reply

Your email address will not be published. Required fields are marked *