[Rt-commit] r9520 - in rt/branches/3.6-EXPERIMENTAL-CATEGORIES: lib/RT

falcone at bestpractical.com falcone at bestpractical.com
Wed Oct 31 22:23:10 EDT 2007


Author: falcone
Date: Wed Oct 31 22:23:09 2007
New Revision: 9520

Modified:
   rt/branches/3.6-EXPERIMENTAL-CATEGORIES/   (props changed)
   rt/branches/3.6-EXPERIMENTAL-CATEGORIES/lib/RT/CustomFieldValue_Overlay.pm

Log:
 r25536 at ketch:  falcone | 2007-10-18 16:27:13 -0400
 * Clean up by removing Category Attributes when we delete the CustomFieldValue


Modified: rt/branches/3.6-EXPERIMENTAL-CATEGORIES/lib/RT/CustomFieldValue_Overlay.pm
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-CATEGORIES/lib/RT/CustomFieldValue_Overlay.pm	(original)
+++ rt/branches/3.6-EXPERIMENTAL-CATEGORIES/lib/RT/CustomFieldValue_Overlay.pm	Wed Oct 31 22:23:09 2007
@@ -92,6 +92,24 @@
     $self->SetAttribute(Name => 'Category', Content => $category);
 }
 
+sub DeleteCategory {
+    my $self = shift;
+    my $attr = $self->FirstAttribute('Category') or return (-1,'No Category Set');
+    return $attr->Delete;
+}
+
+sub Delete {
+    my $self = shift;
+
+    my ($result, $msg) = $self->DeleteCategory;
+
+    unless ($result) {
+        return ($result, $msg);
+    }
+
+    return $self->SUPER::Delete(@_);
+}
+
 sub ValidateName { 1 };
 
 1;


More information about the Rt-commit mailing list