From: <mp...@kr...> - 2007-02-05 19:43:08
|
Revision: 3548 Author: mpeters Date: 2007-02-05 14:42:46 -0500 (Mon, 05 Feb 2007) Log Message: ----------- fixing a bug in Krang::Story::revert() where checked_out could be set to the value of checked_out_by instead of the simple boolean (1/0). This will break "Active Stories". Also adding an upgrade step to fix this on any potentially broken installs. Modified Paths: -------------- trunk/krang/lib/Krang/Story.pm trunk/krang/upgrade/V2_009.pm Modified: trunk/krang/lib/Krang/Story.pm =================================================================== --- trunk/krang/lib/Krang/Story.pm 2007-02-05 16:30:16 UTC (rev 3547) +++ trunk/krang/lib/Krang/Story.pm 2007-02-05 19:42:46 UTC (rev 3548) @@ -1806,7 +1806,7 @@ my %persist = ( version => $self->{version}, checked_out_by => $self->{checked_out_by}, - checked_out => $self->{checked_out_by}, + checked_out => $self->{checked_out}, published_version => $self->{published_version}, publish_date => $self->{publish_date}, url_cache => [], Modified: trunk/krang/upgrade/V2_009.pm =================================================================== --- trunk/krang/upgrade/V2_009.pm 2007-02-05 16:30:16 UTC (rev 3547) +++ trunk/krang/upgrade/V2_009.pm 2007-02-05 19:42:46 UTC (rev 3548) @@ -1,8 +1,8 @@ package V2_009; use strict; use warnings; -use base 'Krang::Upgrade'; - +use Krang::ClassLoader base => 'Upgrade'; +use Krang::ClassLoader DB => 'dbh'; use Krang::Conf qw(KrangRoot); use File::Spec::Functions qw(catfile); @@ -34,6 +34,13 @@ close(CONF); + # previous versions had a bug on stories where checked_out could + # bet set to checked_out_by instead of the simple boolean if the story + # was reverted. Fix this so that 'Active Stories' works again + my $dbh = dbh(); + $dbh->do(qq/ + UPDATE story SET checked_out = 1 WHERE checked_out != 0 + /); } # nothing yet |