rt 4.0.20 (RT#13852)
[freeside.git] / rt / share / html / Search / Elements / BuildFormatString
index 14e3a71..66fd147 100644 (file)
@@ -109,6 +109,8 @@ my @fields = (
   )
 ); # loc_qw
 
+# This callback will only run once and will be removed in 4.4
+# If you want to add a new item to @fields, use the Default callback below.
 $m->callback( CallbackOnce => 1, CallbackName => 'SetFieldsOnce', Fields => \@fields );
 
 my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});
@@ -227,17 +229,17 @@ my @format_string;
 foreach my $field (@seen) {
     next unless $field;
     my $row = "";
-    if ( $field->{'output'} ) {
-        $row = join '', @{$field->{'output'}};
+    if ( $field->{'original_string'} ) {
+        $row = $field->{'original_string'};
     }
     else {
         $row .= $field->{'Prefix'} if defined $field->{'Prefix'};
         $row .= "__$field->{'Column'}__"
           unless ( $field->{'Column'} eq "<blank>" );
         $row .= $field->{'Suffix'} if defined $field->{'Suffix'};
+        $row =~ s!([\\'])!\\$1!g;
+        $row = "'$row'";
     }
-    $row =~ s!([\\'])!\\$1!g;
-    $row = "'$row'";
     push( @format_string, $row );
 }