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

BPS Git Server git at git.bestpractical.com
Thu Nov 2 16:39:30 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  fd4a310b0c2ece4502f5e3cd8ae0a41d167322ed (commit)
       via  926dd962ff78528552da6bf7fa037bb50cee771b (commit)
      from  5ef404606506d5650c58d1ec05bd7bd4c1bf1ac2 (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 fd4a310b0c2ece4502f5e3cd8ae0a41d167322ed
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Nov 2 11:24:09 2023 -0400

    Do not persist validation related args
    
    They are used internally in the same request, so there is no need to
    pass them among requests. Even worse, passing them confuses validation
    logic and could cause RT to create duplicate tickets.

diff --git a/html/FormTools/Form b/html/FormTools/Form
index 325888d..e6b7215 100644
--- a/html/FormTools/Form
+++ b/html/FormTools/Form
@@ -136,6 +136,7 @@ $next_for_validation ||= $m->caller(1)->path;
 % next if $forbid_persisting->{$key};
 % next if ($key eq 'user' or $key eq 'pass');
 % next if $key eq 'Submit'; # No need to pass through "Next" button value
+% next if $key =~ /^(?:validation|validation_ok|next_for_validation)$/;
 <input type="hidden" name="<%$key%>" value="<%$val%>" />
 % }
 % }

commit 926dd962ff78528552da6bf7fa037bb50cee771b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Nov 2 10:17:00 2023 -0400

    Name "Next" button to make sure the form has data to submit
    
    This is to avoid the error of "Malformed multipart POST: data truncated"
    that happens when no form fields are submitted.

diff --git a/html/FormTools/Form b/html/FormTools/Form
index 84b09c2..325888d 100644
--- a/html/FormTools/Form
+++ b/html/FormTools/Form
@@ -135,6 +135,7 @@ $next_for_validation ||= $m->caller(1)->path;
 % foreach my $val ( ref ($request_args{$key}) ? @{$request_args{$key}} : ($request_args{$key})) {
 % next if $forbid_persisting->{$key};
 % next if ($key eq 'user' or $key eq 'pass');
+% next if $key eq 'Submit'; # No need to pass through "Next" button value
 <input type="hidden" name="<%$key%>" value="<%$val%>" />
 % }
 % }
diff --git a/html/Forms/dhandler b/html/Forms/dhandler
index 6cb11bc..7b88305 100644
--- a/html/Forms/dhandler
+++ b/html/Forms/dhandler
@@ -33,7 +33,7 @@ foreach my $element ( @{$form_config->{'formtools-pages'}{$page}{'content'}} ) {
 </%perl>
 
 % if ( $form_config->{'formtools-pages'}{$page}{'next'} ) {
- <& /FormTools/Next, Label => $button_label, Back => $show_back &>
+ <& /FormTools/Next, Label => $button_label, Back => $show_back, Name => 'Submit' &>
 % }
 </&>
 <%init>

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

Summary of changes:
 html/FormTools/Form | 2 ++
 html/Forms/dhandler | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)


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


More information about the Bps-public-commit mailing list