[Jifty-commit] jifty-dbi branch, master, updated. 0.70-1-gfad87e1

Jifty commits jifty-commit at lists.jifty.org
Fri Jun 17 16:24:33 EDT 2011


The branch, master has been updated
       via  fad87e14b6c4993d68297399a7bd65c44c185531 (commit)
      from  7eff0c0752b23506230683e66ef615fead0f58d0 (commit)

Summary of changes:
 lib/Jifty/DBI/Record.pm |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit fad87e14b6c4993d68297399a7bd65c44c185531
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Jun 17 16:02:19 2011 -0400

    Force context when checking the existence of triggers
    
    We reach inside Class::Trigger and need to make sure we don't fall
    victim to the scalar comma operator when __fetch_all_triggers returns.
    
    The most visible bug this caused was canonicalizers and validators not
    making it into record actions.

diff --git a/lib/Jifty/DBI/Record.pm b/lib/Jifty/DBI/Record.pm
index 349564d..4b56e09 100755
--- a/lib/Jifty/DBI/Record.pm
+++ b/lib/Jifty/DBI/Record.pm
@@ -1746,7 +1746,8 @@ sub has_canonicalizer_for_column {
     my $method = "canonicalize_$key";
     if ( $self->can($method) ) {
         return 1;
-    } elsif ( Class::Trigger::__fetch_all_triggers($self, $method) ) {
+    # We have to force context here because we're reaching inside Class::Trigger
+    } elsif ( my @sighs = Class::Trigger::__fetch_all_triggers($self, $method) ) {
         return 1;
     } else {
         return undef;
@@ -1797,7 +1798,8 @@ sub has_validator_for_column {
     my $method = "validate_$key";
     if ( $self->can( $method ) ) {
         return 1;
-    } elsif ( Class::Trigger::__fetch_all_triggers($self, $method) ) {
+    # We have to force context here because we're reaching inside Class::Trigger
+    } elsif ( my @sighs = Class::Trigger::__fetch_all_triggers($self, $method) ) {
         return 1;
     } else {
         return undef;

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


More information about the Jifty-commit mailing list