[Rt-commit] rt branch, 4.2/old-style-categories, created. rt-4.2.3-23-gecf6b91

Alex Vandiver alexmv at bestpractical.com
Wed Mar 5 16:05:57 EST 2014


The branch, 4.2/old-style-categories has been created
        at  ecf6b9123bbfac8e5401818f33c341eda411c0d0 (commit)

- Log -----------------------------------------------------------------
commit ecf6b9123bbfac8e5401818f33c341eda411c0d0
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Mar 5 15:59:01 2014 -0500

    Parse old-style (not chained) Categrory drop-down arguments correctly
    
    As of 4b21442, the string '-Category' is appended to the '-Value' or
    '-Values', instead of replacing it.  Update all of the locations which
    ignore the old-style Category to look for the suffix, instead of the
    fixed string.
    
    Without this, attempts to update custom field values with old-style
    categories produce "User asked for an unknown update type for custom
    field" warnings, and bulk update may erroneously set the CF values to
    their selected category, rather than their selected value.

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 8f690fe..d6e2d35 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -3104,7 +3104,7 @@ sub _ProcessObjectCustomFieldUpdates {
     foreach my $arg ( keys %{ $args{'ARGS'} } ) {
 
         # skip category argument
-        next if $arg eq 'Category';
+        next if $arg =~ /-Category$/;
 
         # since http won't pass in a form element with a null value, we need
         # to fake it
@@ -3255,7 +3255,7 @@ sub ProcessObjectCustomFieldUpdatesForCreate {
             while (my ($arg, $value) = each %{ $custom_fields{$class}{0}{$cfid}{$groupings[0]} }) {
                 # Values-Magic doesn't matter on create; no previous values are being removed
                 # Category is irrelevant for the actual value
-                next if $arg =~ /-Magic$/ or $arg eq "Category";
+                next if $arg =~ /-Magic$/ or $arg =~ /-Category$/;
 
                 push @values,
                     _NormalizeObjectCustomFieldValue(
@@ -3609,7 +3609,7 @@ sub ProcessRecordBulkCustomFields {
     foreach my $key ( keys %$ARGSRef ) {
         next unless $key =~ /^Bulk-(Add|Delete)-CustomField-(\d+)-(.*)$/;
         my ($op, $cfid, $rest) = ($1, $2, $3);
-        next if $rest eq "Category";
+        next if $rest =~ /-Category$/;
 
         my $res = $data{$cfid} ||= {};
         unless (keys %$res) {

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


More information about the rt-commit mailing list