[Jifty-commit] jifty branch, setupwizard-refactor, updated. 20519e4a3d9b2a15314f7fbece4453a8de640d99

Jifty commits jifty-commit at lists.jifty.org
Tue Jul 6 18:25:00 EDT 2010


The branch, setupwizard-refactor has been updated
       via  20519e4a3d9b2a15314f7fbece4453a8de640d99 (commit)
      from  8fc146262b18f7ba5d8869eb1fecd83c9ab4977e (commit)

Summary of changes:
 lib/Jifty/Plugin/SetupWizard/View/Helpers.pm |   11 ++++++++---
 lib/Jifty/Web/Form/Clickable.pm              |    6 ++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 20519e4a3d9b2a15314f7fbece4453a8de640d99
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Jun 29 13:53:58 2010 -0400

    Warn, but don't die, on monikers with no action

diff --git a/lib/Jifty/Plugin/SetupWizard/View/Helpers.pm b/lib/Jifty/Plugin/SetupWizard/View/Helpers.pm
index 0255ad4..495fbce 100644
--- a/lib/Jifty/Plugin/SetupWizard/View/Helpers.pm
+++ b/lib/Jifty/Plugin/SetupWizard/View/Helpers.pm
@@ -194,12 +194,17 @@ template 'database_widget/test_connectivity' => sub {
         };
     }
 
+    my @monikers = qw(test-db-connectivity);
+
+    push @monikers, "addconfig-framework-Database-$_"
+        for qw(Driver Database Host Port User Password RequireSSL);
+
     $action->button(
         label     => _("Test connectivity"),
         onclick   => {
-            # Submit all actions, which will be the database config actions and
-            # then the connectivity test.
-            submit => undef,
+            # We can't just submit all actions, because that will also send the restart action,
+            # which we don't want for just testing the DB
+            submit => \@monikers,
             refresh_self => 1,
         },
         # We need to register the action since we're not providing any arguments
diff --git a/lib/Jifty/Web/Form/Clickable.pm b/lib/Jifty/Web/Form/Clickable.pm
index 29d2535..7733392 100644
--- a/lib/Jifty/Web/Form/Clickable.pm
+++ b/lib/Jifty/Web/Form/Clickable.pm
@@ -621,6 +621,12 @@ sub generate {
                 $self->{submit} ||= [];
                 for my $moniker ( @{ $hook->{submit} } ) {
                     my $action = $web->{'actions'}{$moniker};
+
+                    if ( not defined $action ) {
+                        $self->log->warn("Trying to submit moniker with no registered action -- skipping!");
+                        next;
+                    }
+
                     $self->register_action($action);
                     $self->parameter( $action->form_field_name($_),
                         $hook->{action_arguments}{$moniker}{$_} )

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


More information about the Jifty-commit mailing list