Make revisedBy a property, so it gets written on ->update. Change addRev not to write to the db when it does not need to. Update tests to verify that addRev does the right thing for tagId and revisedBy.
This commit is contained in:
parent
9155f70555
commit
d66b3b891b
3 changed files with 11 additions and 13 deletions
|
|
@ -114,17 +114,8 @@ sub addRevision {
|
|||
}
|
||||
$session->db->commit;
|
||||
|
||||
my $sql = "update assetData set revisedBy=?, tagId=? where assetId=? and revisionDate=?";
|
||||
|
||||
$session->db->write($sql,[
|
||||
$session->user->userId,
|
||||
$workingTag->getId,
|
||||
$self->getId,
|
||||
$now,
|
||||
]);
|
||||
|
||||
# current values, and the user set properties
|
||||
my %mergedProperties = (%{$self->get}, %{$properties}, (status => 'pending'));
|
||||
my %mergedProperties = (%{$self->get}, %{$properties}, (status => 'pending', revisedBy => $session->user->userId, tagId => $workingTag->getId), );
|
||||
|
||||
#Instantiate new revision and fill with real data
|
||||
my $newVersion = WebGUI::Asset->newById($session, $self->getId, $now);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue