[Rt-commit] rt branch, 4.0/premature-redirection-in-articles, created. rt-4.0.2-26-gc8121d4

Kevin Falcone falcone at bestpractical.com
Thu Aug 25 19:55:06 EDT 2011


The branch, 4.0/premature-redirection-in-articles has been created
        at  c8121d41e4cf3191376e3878f88450eaeefdc3c2 (commit)

- Log -----------------------------------------------------------------
commit dbea07f1622c457a98f238a665c768e0881414b8
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Aug 25 19:53:24 2011 -0400

    You can't edit description and an attribute
    
    We redirect before any of the checkboxes are stored, so you have to do
    your editing, submit and then check things off.

diff --git a/t/articles/class.t b/t/articles/class.t
index 886ad38..784aeb3 100644
--- a/t/articles/class.t
+++ b/t/articles/class.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 13;
+use RT::Test tests => 24;
 
 use_ok 'RT::Articles';
 use_ok 'RT::Classes';
@@ -54,3 +54,23 @@ $u->PrincipalObj->GrantRight(Right =>'AdminClass', Object => RT->System);
 ($id, $msg) = $cl->Create(Name => 'Test-nobody-'.$$, Description => 'A test class');
 
 ok ($id, $msg. "- Can create classes as a random new user after ACL grant");
+
+# now check the Web UI
+
+my ($url, $m) = RT::Test->started_ok;
+ok($m->login);
+$m->get_ok("$url/Admin/Articles/Classes/Modify.html?Create=1");
+$m->content_contains('Create a Class', 'found title');
+$m->submit_form_ok({
+    form_number => 3,
+    fields => { Name => 'Test Redirect' },
+});
+$m->content_contains('Object created', 'found results');
+$m->content_contains('Editing Configuration for Class Test Redirect', 'found title');
+$m->form_number(3);
+$m->untick( 'Include-Name', 1 );
+$m->field( 'Description', 'Test Description' );
+$m->submit();
+$m->content_like(qr/Description changed from.*no value.*to .*Test Description/,'description changed');
+$m->form_number(3);
+is($m->current_form->find_input('Include-Name')->value,undef,'Disabled Including Names for this Class');

commit c8121d41e4cf3191376e3878f88450eaeefdc3c2
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Aug 25 19:54:41 2011 -0400

    Redirect after we actually process everything
    
    This also means that messages from the other updates are shown to the
    user.

diff --git a/share/html/Admin/Articles/Classes/Modify.html b/share/html/Admin/Articles/Classes/Modify.html
index cab33c4..ac22fd9 100644
--- a/share/html/Admin/Articles/Classes/Modify.html
+++ b/share/html/Admin/Articles/Classes/Modify.html
@@ -122,12 +122,6 @@ if ($ClassObj->Id()) {
                                        ARGSRef => \%ARGS);
 }
 
-# This code does automatic redirection if any updates happen.
-MaybeRedirectForResults(
-    Actions     => \@results,
-    Arguments   => { id => $ClassObj->Id },
-);
-
 #we're asking about enabled on the web page but really care about disabled.
 if ((defined $Enabled && $Enabled == 1) or (not defined $Enabled and $Create)) {
     $Disabled = 0;
@@ -154,6 +148,13 @@ if  ( $Submitted ) {
     }
 }
 
+# This code does automatic redirection if any updates happen.
+MaybeRedirectForResults(
+    Actions     => \@results,
+    Arguments   => { id => $ClassObj->Id },
+);
+
+
 $include{$_} = not $ClassObj->FirstAttribute("Skip-$_") for keys %include;
 $include{$_} = $include{$_} ? " CHECKED" : "" for keys %include;
 

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


More information about the Rt-commit mailing list