[Jifty-commit] jifty branch, master, updated. 1.10518-35-g896d9d8

Jifty commits jifty-commit at lists.jifty.org
Tue Jul 12 12:17:18 EDT 2011


The branch, master has been updated
       via  896d9d86fe0f4b357b1fd556d8987687e3a6b60f (commit)
      from  c473f1fd2f3da21ba1421994d10e83b434250f8e (commit)

Summary of changes:
 lib/Jifty/View/Declare/Helpers.pm |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 896d9d86fe0f4b357b1fd556d8987687e3a6b60f
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Jul 12 12:15:09 2011 -0400

    Template args should be able to be 0
    
    set(foo => 0) works, but you can't pull it back out with get('foo')
    unless you test definedness, not truth.
    
    We really want the // operator here.  Hopefully this doesn't break any
    assumptions about get(); the tests do pass.

diff --git a/lib/Jifty/View/Declare/Helpers.pm b/lib/Jifty/View/Declare/Helpers.pm
index 6f73be3..eb508d7 100644
--- a/lib/Jifty/View/Declare/Helpers.pm
+++ b/lib/Jifty/View/Declare/Helpers.pm
@@ -50,7 +50,8 @@ sub get {
 sub request; # defined later
 
 sub _get_single {
-    my $v = request->template_argument($_[0]) || request->argument( $_[0] );
+    my $v = request->template_argument($_[0]);
+       $v = request->argument( $_[0] ) if not defined $v;
     return $v if defined $v;
 
     if (request->top_request ne request() and $v = request->top_request->template_argument($_[0])) {

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


More information about the Jifty-commit mailing list