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

BPS Git Server git at git.bestpractical.com
Thu Nov 30 22:33:54 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  dbac26cd703eed4413436c4ae4107fe6889849ca (commit)
      from  9cf2a2c48a6ba44d0d293430cd533073a34e14d7 (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 dbac26cd703eed4413436c4ae4107fe6889849ca
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Nov 30 17:28:34 2023 -0500

    Save queue name instead of id for better portability

diff --git a/html/Admin/FormTools/Create.html b/html/Admin/FormTools/Create.html
index 0ab9ed1..6177836 100644
--- a/html/Admin/FormTools/Create.html
+++ b/html/Admin/FormTools/Create.html
@@ -35,12 +35,20 @@ if ( $Create ) {
         if ($ret) {
             push @results, loc( 'Name [_1] already exists', $Description );
         }
-        else {
+
+        my $queue_obj = RT::Queue->new( $session{CurrentUser} );
+        $queue_obj->Load($Queue);
+        if ( !$queue_obj->Id ) {
+            push @results, loc( 'Invalid queue [_1]', $Queue );
+        }
+
+        # It indicates something wrong if @results is not empty
+        if ( !@results ) {
             my ( $ret, $msg ) = $form->Create(
                 Name        => 'FormTools Form',
                 Description => $ARGS{Description},
                 Object      => RT->System,
-                Content     => { queue => $ARGS{Queue} },
+                Content     => { queue => $queue_obj->Name },
             );
 
             if ($ret) {

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

Summary of changes:
 html/Admin/FormTools/Create.html | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)


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


More information about the Bps-public-commit mailing list