[Jifty-commit] r7581 - jifty/trunk/lib/Jifty/Web/Form

Jifty commits jifty-commit at lists.jifty.org
Tue Nov 3 16:36:59 EST 2009


Author: sartak
Date: Tue Nov  3 16:36:58 2009
New Revision: 7581

Modified:
   jifty/trunk/lib/Jifty/Web/Form/Field.pm

Log:
Revert r7332 since it breaks SetupWizard

    The reason r7332 reverted previous commits is to fix Hiveminder's
    "saved list" functionality, but that continues to work even when
    7332 is backed out by this commit.

Modified: jifty/trunk/lib/Jifty/Web/Form/Field.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Field.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Form/Field.pm	Tue Nov  3 16:36:58 2009
@@ -127,7 +127,7 @@
 );
 
 my @semiexposed_fields = qw(
-    label input_name
+    label input_name available_values
 );
 
 sub accessors {
@@ -841,7 +841,19 @@
 
 sub available_values {
     my $self = shift;
-    return @{ $self->action->available_values($self->name) || [] };
+
+    # Setter
+    if (@_) {
+        return $self->_available_values(@_);
+    }
+
+    # If the available_values are available in the field..
+    if (my $available = $self->_available_values) {
+        return @$available;
+    }
+
+    # Otherwise consult the action
+    return @{ $self->action->available_values($self->name) };
 }
 
 =for private


More information about the Jifty-commit mailing list