[Bps-public-commit] rt-extension-formtools branch, master, updated. 0.07_07-18-g494ac96

Kevin Falcone falcone at bestpractical.com
Wed Feb 1 18:31:36 EST 2012


The branch, master has been updated
       via  494ac969ded4e63a020fa7f4875e4b2ffbc9be2b (commit)
       via  779d5876f65cb7db21a67cf48c07b79649f39e5b (commit)
      from  bb810f52528ab1fd0d829e24a7b8babf9fc7b295 (commit)

Summary of changes:
 html/FormTools/Field |   36 ++++++++++++++++++------------------
 html/FormTools/Form  |   12 ++++++------
 2 files changed, 24 insertions(+), 24 deletions(-)

- Log -----------------------------------------------------------------
commit 779d5876f65cb7db21a67cf48c07b79649f39e5b
Author: Matt Zagrabelny <mzagrabe at d.umn.edu>
Date:   Tue Jan 31 13:45:55 2012 -0600

    Be graceful about $queue not being defined
    
    If $queue is not defined, then this Mason component blows up. These
    conditionals should catch that. Also perform generic Load for CF if
    queue specific and global loads fail.

diff --git a/html/FormTools/Field b/html/FormTools/Field
index 5151325..5021f96 100644
--- a/html/FormTools/Field
+++ b/html/FormTools/Field
@@ -43,14 +43,14 @@ if ( RT::Extension::FormTools::is_core_field($name) ) {
     $cf = RT::CustomField->new( $session{'CurrentUser'} );
     $cf->SetContextObject($ticket) if $cf->can('SetContextObject');
 
-    # try loading CFs for this Queue, followed by Global
-    $cf->LoadByName( Name => $name, Queue => $queue->id );
+    # try loading CFs for this Queue, followed by Global, followed by any CF of given $name
+    $cf->LoadByName( Name => $name, Queue => $queue->id ) if (defined $queue);
+    $cf->LoadByName( Name => $name, Queue => 0 ) unless ( $cf->id );
+    $cf->LoadByName( Name => $name ) unless ( $cf->id );
     unless ( $cf->id ) {
-        $cf->LoadByName( Name => $name, Queue => 0 );
-    }
-    unless ( $cf->id ) {
-        die "Could not find a custom field called $name for the queue "
-            . $queue->Name;
+        my $msg = "Could not find a custom field called $name";
+        $msg .= " for the queue ".$queue->Name if (defined $queue);
+        die $msg;
     }
 
     $m->notes( cfs_on_page => [ @{$m->notes('cfs_on_page')||[]}, $cf->id ] );

commit 494ac969ded4e63a020fa7f4875e4b2ffbc9be2b
Author: Matt Zagrabelny <mzagrabe at d.umn.edu>
Date:   Tue Jan 31 13:48:28 2012 -0600

    Align Mason args using whitespace
    
    Make ARGS parameters look (arguably) "better".

diff --git a/html/FormTools/Field b/html/FormTools/Field
index 5021f96..83182c6 100644
--- a/html/FormTools/Field
+++ b/html/FormTools/Field
@@ -1,16 +1,16 @@
 <%args>
 $name
-$label => undef
-$item_labels => {}
-$render_as => 'normal'
-$default => undef
-$cols => undef
-$rows => undef
-$empty_allowed => 1
-$show_validation => 0
-$show_label => 1
-$disables => {}
-$enabled_by => []
+$label              => undef
+$item_labels        => {}
+$render_as          => 'normal'
+$default            => undef
+$cols               => undef
+$rows               => undef
+$empty_allowed      => 1
+$show_validation    => 0
+$show_label         => 1
+$disables           => {}
+$enabled_by         => []
 $container_selector => undef
 </%args>
 <%init>
diff --git a/html/FormTools/Form b/html/FormTools/Form
index 6a761e7..04a6669 100644
--- a/html/FormTools/Form
+++ b/html/FormTools/Form
@@ -1,13 +1,13 @@
 <%args>
 $next
 $next_for_validation => undef
-$include_header => 1
+$include_header      => 1
 $include_page_layout => 1
-$ShowBar => 1
-$validation => 0
-$forbid_persisting => {}
-$form_id => undef
-$self_service => 0
+$ShowBar             => 1
+$validation          => 0
+$forbid_persisting   => {}
+$form_id             => undef
+$self_service        => 0
 </%args>
 <%init>
 use RT::Extension::FormTools;

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



More information about the Bps-public-commit mailing list