[Rt-commit] rt branch, 3.8/stop-saving-multiple-basedon, created. rt-3.8.10-4-g4cdce8c

Kevin Falcone falcone at bestpractical.com
Wed May 11 11:14:19 EDT 2011


The branch, 3.8/stop-saving-multiple-basedon has been created
        at  4cdce8c2b0dca40e3ef0abfe433dc9e0627d099e (commit)

- Log -----------------------------------------------------------------
commit 4cdce8c2b0dca40e3ef0abfe433dc9e0627d099e
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed May 11 11:08:51 2011 -0400

    Without this, it was possible to have multiple BasedOn Attributes
    
    Any time you hit Save on the CF Modify.html page it would add a new
    BasedOn Attribute.  This causes problems when upgrading to 4.0 and I'm
    not entirely sure what happens if you end up with 6 attributes linking
    CF1 and CF2 and 4 linking CF1 and CF3.
    
    Changing to SetAttribute will automatically delete all the extra
    attributes for us, getting us lazy cleanup.

diff --git a/lib/RT/CustomField_Overlay.pm b/lib/RT/CustomField_Overlay.pm
index 9cf608e..5db11db 100755
--- a/lib/RT/CustomField_Overlay.pm
+++ b/lib/RT/CustomField_Overlay.pm
@@ -1417,7 +1417,7 @@ sub SetBasedOn {
     return (0, "Permission denied")
         unless $cf->Id && $cf->CurrentUserHasRight('SeeCustomField');
 
-    return $self->AddAttribute(
+    return $self->SetAttribute(
         Name => "BasedOn",
         Description => "Custom field whose CF we depend on",
         Content => $cf->Id,

-----------------------------------------------------------------------


More information about the Rt-commit mailing list