[Rt-commit] rt branch 4.4/cf-grouping-class-back-compat created. rt-4.4.5-101-g5d4bac0f0b

BPS Git Server git at git.bestpractical.com
Thu May 5 18:58:10 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 4.4/cf-grouping-class-back-compat has been created
        at  5d4bac0f0b3df0b6b904193b6d7af79f5439ab74 (commit)

- Log -----------------------------------------------------------------
commit 5d4bac0f0b3df0b6b904193b6d7af79f5439ab74
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 5 21:25:16 2022 +0800

    Return record class in scalar context for backward compatibility
    
    Previously in 46cc17adf2 we added category-level custom field groupings,
    where we changed _GroupingClass to return both record class and category
    name, which in scalar context returned category name instead of record
    class.
    
    This commit changes to return record class in scalar context just like
    before, for backword compatibility. It also fixes a potential issue with
    RTIR(it overrides _GroupingClass) if RT is updated but RTIR is not, in
    which case the RT::CustomField::Groupings call could cause an infinite
    recursion(e.g. on ticket create page).

diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
index aa13f25d61..2532f5961b 100644
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -1596,7 +1596,7 @@ sub _GroupingClass {
         my ($container_object) = $record->CategoryObj;
         $category = $container_object->Name if $container_object;
     }
-    return ( $record_class, $category );
+    return wantarray ? ( $record_class, $category ) : $record_class;
 }
 
 =head2 RegisterBuiltInGroupings

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list