[Bps-public-commit] RT-Extension-MandatoryOnTransition branch custom-field-value-is-empty-check created. 0.20-1-ga799227

BPS Git Server git at git.bestpractical.com
Wed Oct 27 19:33:33 UTC 2021


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-Extension-MandatoryOnTransition".

The branch, custom-field-value-is-empty-check has been created
        at  a799227cf0c408be4b84c285762a81acfda0ab73 (commit)

- Log -----------------------------------------------------------------
commit a799227cf0c408be4b84c285762a81acfda0ab73
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Oct 28 01:00:35 2021 +0800

    Call CustomFieldValueIsEmpty to treat empty date custom field values as absent
    
    If RT can't extract date from the passed value, then the field should be
    treated as "missing".

diff --git a/lib/RT/Extension/MandatoryOnTransition.pm b/lib/RT/Extension/MandatoryOnTransition.pm
index b811583..a0410fc 100644
--- a/lib/RT/Extension/MandatoryOnTransition.pm
+++ b/lib/RT/Extension/MandatoryOnTransition.pm
@@ -841,6 +841,10 @@ sub CheckMandatoryFields {
                 grep defined, $value;
         }
 
+        if ( $cf->can('CustomFieldValueIsEmpty') && $cf->CustomFieldValueIsEmpty( Field => $cf, Value => $value ) ) {
+            undef $value;
+        }
+
         # Check for specific values
         if ( exists $must_values->{$cf->Name} ){
             my $cf_value = $value;

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


hooks/post-receive
-- 
RT-Extension-MandatoryOnTransition


More information about the Bps-public-commit mailing list