[Rt-commit] rt branch, 4.0/disallow-blank-field-names, updated. rt-4.0.2-194-g1e6966b

Alex Vandiver alexmv at bestpractical.com
Tue Oct 25 12:49:36 EDT 2011


The branch, 4.0/disallow-blank-field-names has been updated
       via  1e6966bd54244920f0d883d3c004f01a1aebe725 (commit)
      from  7f311a70edf1e3a96e48443045881e76679cde9c (commit)

Summary of changes:
 share/html/Admin/Queues/Modify.html |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit 1e6966bd54244920f0d883d3c004f01a1aebe725
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Oct 25 12:41:42 2011 -0400

    Properly set the title when queue creation fails
    
    Rather than band-aid a ||'' to prevent loc() warnings when validation
    fails (causing $QueueObj to not have a valid object in it), set the
    title later, once it is clear if we have a valid object.

diff --git a/share/html/Admin/Queues/Modify.html b/share/html/Admin/Queues/Modify.html
index 153fd88..186e0da 100755
--- a/share/html/Admin/Queues/Modify.html
+++ b/share/html/Admin/Queues/Modify.html
@@ -166,22 +166,20 @@ $QueueObj->Load( $id ) if !$id || $id eq 'new';
 
 $EnabledChecked = 'checked="checked"';
 
-if ($Create) {
-    $title = loc("Create a queue");
-} else {
+unless ($Create) {
     if ( defined $id && $id eq 'new' ) {
         my ($val, $msg) = $QueueObj->Create( Name => $Name );
         if (!$val) {
             $Create = 1; # Create failed, so bring us back to step 1
         }
         push @results, $msg;
-    }
-    else {
+    } else {
         $QueueObj->Load($id) || $QueueObj->Load($Name) || Abort(loc("Couldn't load queue '[_1]'", $Name));
     }
-    $title = loc('Configuration for queue [_1]', $QueueObj->Name||'');
 }
+
 if ( $QueueObj->Id ) {
+    $title = loc('Configuration for queue [_1]', $QueueObj->Name );
     my @attribs= qw(Description CorrespondAddress CommentAddress Name
         InitialPriority FinalPriority DefaultDueIn Sign Encrypt Lifecycle SubjectTag Disabled);
 
@@ -226,6 +224,8 @@ if ( $QueueObj->Id ) {
             push @no_redirect_results, loc("RTAddressRegexp option in the config doesn't match [_1]", $address );
         }
     }
+} else {
+    $title = loc("Create a queue");
 }
 
 # This code does automatic redirection if any updates happen.

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


More information about the Rt-commit mailing list