[Bps-public-commit] rt-extension-formtools branch dynamic-forms-from-config updated. 0.53-67-g827f574

BPS Git Server git at git.bestpractical.com
Fri Oct 27 20:54:10 UTC 2023


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-formtools".

The branch, dynamic-forms-from-config has been updated
       via  827f574bd6d31cd0717bab6bfdd8916bfc7eb97b (commit)
      from  075699f085165988f1316f1cce14704ae155acef (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 827f574bd6d31cd0717bab6bfdd8916bfc7eb97b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Oct 27 16:44:54 2023 -0400

    Remove empty cf values to avoid possible validation errors on back
    
    This is to avoid unnecessary cf validations for the following case: user
    clicks "Next" to go to the next page that has a mandatory cf input, then
    clicks "Back" without setting the cf to go to the previous page, then
    clicks "Next" again which caused validation error.

diff --git a/html/Forms/dhandler b/html/Forms/dhandler
index ddf363c..0e84256 100644
--- a/html/Forms/dhandler
+++ b/html/Forms/dhandler
@@ -142,6 +142,12 @@ if ( $ARGS{Back} and $ARGS{Back} eq 'Back' ) {
     $_form_tools_next = '';
     delete $ARGS{'_form_tools_next'} if $ARGS{'_form_tools_next'};
 
+    for my $field ( grep { /Object-RT::Ticket--CustomField-/ } keys %ARGS ) {
+        next if length $ARGS{$field};
+        delete $ARGS{$field};
+        delete $ARGS{"$field-Magic"};
+    }
+
     # Redirect to the previous page
     MaybeRedirectForResults(
         Path      => $base_path . $form_name . '/' . $back_page,

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

Summary of changes:
 html/Forms/dhandler | 6 ++++++
 1 file changed, 6 insertions(+)


hooks/post-receive
-- 
rt-extension-formtools


More information about the Bps-public-commit mailing list