projects
/
evergreen
/
equinox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
983c0ec
)
delete match_set_point's starting with leaf nodes to avoid foreign key constraints...
author
berick
<berick@esilibrary.com>
Tue, 3 May 2011 18:42:09 +0000
(14:42 -0400)
committer
berick
<berick@esilibrary.com>
Tue, 3 May 2011 18:42:09 +0000
(14:42 -0400)
Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm
patch
|
blob
|
history
diff --git
a/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm
b/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm
index
c5fb58f
..
1a352e5
100644
(file)
--- a/
Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm
+++ b/
Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm
@@
-1420,8
+1420,15
@@
sub match_set_update_tree {
{"order_by" => {"vmsp" => "id DESC"}}
]) or return $e->die_event;
- foreach (@$existing) {
- $e->delete_vandelay_match_set_point($_) or return $e->die_event;
+ # delete points, working up from leaf points to the root
+ while(@$existing) {
+ for my $point (shift @$existing) {
+ if( grep {$_->parent eq $point->id} @$existing) {
+ push(@$existing, $point);
+ } else {
+ $e->delete_vandelay_match_set_point($point) or return $e->die_event;
+ }
+ }
}
_walk_new_vmsp($e, $match_set_id, $tree);