[Jifty-commit] r4183 - in apps/CASPlus/trunk: lib/CASPlus/Util

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Oct 2 12:03:24 EDT 2007


Author: sterling
Date: Tue Oct  2 12:03:24 2007
New Revision: 4183

Modified:
   apps/CASPlus/trunk/   (props changed)
   apps/CASPlus/trunk/lib/CASPlus/Util/Relationship.pm

Log:
 r12774 at dynpc145:  andrew | 2007-10-02 10:32:33 -0500
 Fixed some bugs relating to how the user role cache is calculated.


Modified: apps/CASPlus/trunk/lib/CASPlus/Util/Relationship.pm
==============================================================================
--- apps/CASPlus/trunk/lib/CASPlus/Util/Relationship.pm	(original)
+++ apps/CASPlus/trunk/lib/CASPlus/Util/Relationship.pm	Tue Oct  2 12:03:24 2007
@@ -380,7 +380,7 @@
             my $parent = $child->$method;
 
             # Only add it if it's set
-            if ($parent->id) {
+            if (defined $parent and $parent->id) {
                 push @parents, $parent;
                 $class->add_relationship(
                     child        => $child,
@@ -395,14 +395,16 @@
             my $parent_links = $child->$method;
 
             # Similar to one-to-many, but an extra jump
-            while (my $parent_link = $parent_links->next) {
-                my $parent = $parent_link->parent;
-                push @parents, $parent;
-                $class->add_relationship(
-                    child        => $child,
-                    relationship => $relationship,
-                    parent       => $parent,
-                );
+            if (defined $parent_links) {
+                while (my $parent_link = $parent_links->next) {
+                    my $parent = $parent_link->parent;
+                    push @parents, $parent;
+                    $class->add_relationship(
+                        child        => $child,
+                        relationship => $relationship,
+                        parent       => $parent,
+                    );
+                }
             }
         }
     }


More information about the Jifty-commit mailing list