fixed a bug in Matrix deleteAttribute method

This commit is contained in:
Yung Han Khoe 2008-12-02 11:18:02 +00:00
parent bde609f5cb
commit a4207e7ec5
2 changed files with 28 additions and 0 deletions

View file

@ -201,6 +201,17 @@ sub deleteAttribute {
my $attributeId = shift;
$self->deleteCollateral("Matrix_attribute","attributeId",$attributeId);
$self->session->db->write("delete from MatrixListing_attribute where attributeId=? and matrixId=?",
[$attributeId,$self->getId]);
# recalculate scores for MatrixListings
my @listings = @{ $self->getLineage(['descendants'], {
includeOnlyClasses => ['WebGUI::Asset::MatrixListing'],
returnObjects => 1,
}) };
foreach my $listing (@listings){
$listing->updateScore;
}
return undef;
}