fix: purge old asset revisions could purge the most recent revision if the
database had some referential integrity probems
This commit is contained in:
parent
265400a010
commit
1e9e4d810f
4 changed files with 82 additions and 24 deletions
|
|
@ -1652,15 +1652,7 @@ sub new {
|
|||
return undef;
|
||||
}
|
||||
|
||||
my $assetRevision = $session->stow->get("assetRevision");
|
||||
my $revisionDate = shift || $assetRevision->{$assetId}{$session->scratch->get("versionTag")||'_'};
|
||||
unless ($revisionDate) {
|
||||
($revisionDate) = $session->db->quickArray("select max(revisionDate) from assetData where assetId=? and
|
||||
(status='approved' or status='archived' or tagId=?) order by assetData.revisionDate",
|
||||
[$assetId, $session->scratch->get("versionTag")]);
|
||||
$assetRevision->{$assetId}{$session->scratch->get("versionTag")||'_'} = $revisionDate;
|
||||
$session->stow->set("assetRevision",$assetRevision);
|
||||
}
|
||||
my $revisionDate = shift || $class->getCurrentRevisionDate($session, $assetId);
|
||||
return undef unless ($revisionDate);
|
||||
|
||||
unless ($class ne 'WebGUI::Asset' or defined $className) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue