[Rt-commit] rt branch, 4.2/retain-default-cf-value-on-refresh, created. rt-4.1.6-287-g092a082

Jim Brandt jbrandt at bestpractical.com
Fri Mar 1 08:59:40 EST 2013


The branch, 4.2/retain-default-cf-value-on-refresh has been created
        at  092a082596b74413b36fb8179d01299ce127897a (commit)

- Log -----------------------------------------------------------------
commit ad7945fa945d8cbe7b64555fa7279bf5824accd7
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Feb 28 15:32:11 2013 -0500

    Test showing cf value is lost on refresh to add attachment

diff --git a/t/web/cf_select_one.t b/t/web/cf_select_one.t
index 92fcf53..36e6b7a 100644
--- a/t/web/cf_select_one.t
+++ b/t/web/cf_select_one.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 45;
+use RT::Test tests => undef;
 
 my ($baseurl, $m) = RT::Test->started_ok;
 ok $m->login, 'logged in as root';
@@ -151,3 +151,32 @@ diag "check that we can set empty value when the current is 0";
        undef, 'API returns correct value';
 }
 
+diag 'retain selected cf values when adding attachments';
+{
+    my ( $ticket, $id );
+    $m->submit_form(
+        form_name => "CreateTicketInQueue",
+        fields    => { Queue => 'General' },
+    );
+    $m->content_contains($cf_name, 'Found cf field' );
+
+    $m->submit_form_ok(
+                       { form_name => "TicketCreate",
+          fields    => {
+              Subject        => 'test defaults',
+              Content        => 'test',
+              "Object-RT::Ticket--CustomField-$cfid-Values" => 'qwe',
+            },
+            button => 'AddMoreAttach',
+        },
+        'Add an attachment on create'
+    );
+
+    $m->form_name("TicketCreate");
+    is($m->value("Object-RT::Ticket--CustomField-$cfid-Values"),
+       "qwe",
+       "Selected value still on form" );
+}
+
+undef $m;
+done_testing;

commit 092a082596b74413b36fb8179d01299ce127897a
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Mar 1 08:58:30 2013 -0500

    Allow default arguments to re-populate form

diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 1c78de4..e4711c4 100644
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -114,7 +114,6 @@
     %ARGS,
     Object => $ticket,
     CustomFieldGenerator => sub { $QueueObj->TicketCustomFields },
-    DefaultsFromTopArguments => 0,
 &>
 
 </div>

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


More information about the Rt-commit mailing list