[Rt-commit] rt branch, update-action, updated. 0c38c6c17e0c8f95e657d5a3d1d0f7f903cf2c7f

sartak at bestpractical.com sartak at bestpractical.com
Wed Dec 16 14:33:13 EST 2009


The branch, update-action has been updated
       via  0c38c6c17e0c8f95e657d5a3d1d0f7f903cf2c7f (commit)
      from  cfeb122562fa3b37e79166234da1d0f748474105 (commit)

Summary of changes:
 lib/RT/Action/TicketAction.pm |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 0c38c6c17e0c8f95e657d5a3d1d0f7f903cf2c7f
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Dec 16 14:32:52 2009 -0500

    We actually add a canonicalizer when they add a parameter
    
        Not when we create a parameter of a given type

diff --git a/lib/RT/Action/TicketAction.pm b/lib/RT/Action/TicketAction.pm
index 28a76f0..92e7d35 100644
--- a/lib/RT/Action/TicketAction.pm
+++ b/lib/RT/Action/TicketAction.pm
@@ -151,6 +151,8 @@ sub _add_parameter_type {
         return @{ $self->{$key} || [] };
     };
 
+    my $canonicalizer = $args{canonicalizer};
+
     *{$class."::$add_method"} = sub {
         use strict 'refs';
         my $self = shift;
@@ -164,13 +166,14 @@ sub _add_parameter_type {
             %defaults,
             %args,
         ));
-    };
 
-    if (my $canonicalizer = $args{canonicalizer}) {
-        unless ($class->can("canonicalize_$name")) {
-            *{$class."::canonicalize_$name"} = $canonicalizer;
+        if ($canonicalizer) {
+            unless ($class->can("canonicalize_$parameter")) {
+                no strict 'refs';
+                *{$class."::canonicalize_$parameter"} = $canonicalizer;
+            }
         }
-    }
+    };
 }
 
 __PACKAGE__->_add_parameter_type(

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


More information about the Rt-commit mailing list