]> git.uio.no Git - usit-rt.git/blobdiff - share/html/Elements/ColumnMap
Upgrade to 4.2.2
[usit-rt.git] / share / html / Elements / ColumnMap
index e8ede1da22be0750122856ef98e97b7e72fbf6c6..ac252f1295d91f2972ab04146754dcb91dddc889 100644 (file)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -52,9 +52,11 @@ $Attr  => undef
 </%ARGS>
 <%ONCE>
 
+use Scalar::Util;
+
 # This is scary and should totally be refactored -- jesse
-my $COLUMN_MAP;
-$COLUMN_MAP = {
+my ($COLUMN_MAP, $WCOLUMN_MAP);
+$WCOLUMN_MAP = $COLUMN_MAP = {
     id => {
         attribute => 'id',
         title     => '#', # loc
@@ -97,7 +99,7 @@ $COLUMN_MAP = {
         attribute => sub { return shift @_ },
         title     => sub { return pop @_ },
         value     => sub {
-            my $self = $COLUMN_MAP->{CustomField};
+            my $self = $WCOLUMN_MAP->{CustomField};
             my $cf   = $self->{load}->(@_);
             return unless $cf->Id;
             return $self->{render}->( $cf, $cf->ValuesForObject($_[0])->ItemsArrayRef );
@@ -203,6 +205,8 @@ $COLUMN_MAP = {
 
 $COLUMN_MAP->{'CF'} = $COLUMN_MAP->{'CustomField'};
 
+Scalar::Util::weaken($WCOLUMN_MAP);
+
 my $ROLE_MAP = {};
 
 </%ONCE>