More rank swapping tests, cleaned up a bug in the tests that passed but should
not have. Updated the POD in AssetLineage to show which methods alter the object's stored lineage versus the information in the database.
This commit is contained in:
parent
5e643336bb
commit
483daf6671
2 changed files with 30 additions and 6 deletions
|
|
@ -100,7 +100,8 @@ sub addChild {
|
|||
|
||||
=head2 cascadeLineage ( newLineage [,oldLineage] )
|
||||
|
||||
Updates lineage when asset is moved. Prepends newLineage to the lineage "stack."
|
||||
Updates lineage when asset is moved. Prepends newLineage to the lineage
|
||||
"stack." The change only occurs in the db, no in the objects.
|
||||
|
||||
=head3 newLineage
|
||||
|
||||
|
|
@ -117,7 +118,7 @@ sub cascadeLineage {
|
|||
my $newLineage = shift;
|
||||
my $oldLineage = shift || $self->get("lineage");
|
||||
my $prepared = $self->session->db->prepare("update asset set lineage=? where assetId=?");
|
||||
my $descendants = $self->session->db->read("select assetId,lineage from asset where lineage like ".$self->session->db->quote($oldLineage.'%'));
|
||||
my $descendants = $self->session->db->read("select assetId,lineage from asset where lineage like ?",[$oldLineage.'%']);
|
||||
my $cache = WebGUI::Cache->new($self->session);
|
||||
while (my ($assetId, $lineage) = $descendants->array) {
|
||||
my $fixedLineage = $newLineage.substr($lineage,length($oldLineage));
|
||||
|
|
@ -134,6 +135,8 @@ sub cascadeLineage {
|
|||
|
||||
Swaps lineage with sister below. Returns 1 if there is a sister to swap. Otherwise returns 0.
|
||||
|
||||
This will update the lineage of $self, but not the sister.
|
||||
|
||||
=cut
|
||||
|
||||
sub demote {
|
||||
|
|
@ -630,6 +633,8 @@ sub newByLineage {
|
|||
|
||||
Keeps the same rank of lineage, swaps with sister above. Returns 1 if there is a sister to swap. Otherwise returns 0.
|
||||
|
||||
This will update the lineage of $self, but not the sister.
|
||||
|
||||
=cut
|
||||
|
||||
sub promote {
|
||||
|
|
@ -729,7 +734,8 @@ Returns 1. Swaps current rank with second rank.
|
|||
|
||||
=head3 first
|
||||
|
||||
If specified, swaps second rank with first rank.
|
||||
If specified, swaps second rank with first rank. The change only occurs in the db,
|
||||
no in the objects.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue