making <context> based orgs work
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 11 Mar 2008 19:32:53 +0000 (19:32 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 11 Mar 2008 19:32:53 +0000 (19:32 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@8977 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/PermaCrud.pm

index ea0160a..bd3029d 100644 (file)
@@ -146,11 +146,11 @@ sub CRUD_action_object_permcheck {
                         my $link_class_hint = $link_node->getAttribute('class');
                         my $remote_field = $link_node->getAttribute('key');
 
-                        my ($remote_class_node) = $xpc->findnodes( "//idl:class[\@id='$self->{class_hint}']", $idl->documentElement );
+                        my ($remote_class_node) = $xpc->findnodes( "//idl:class[\@id='$link_class_hint']", $idl->documentElement );
                         my $search_method = 'search_' . $xpc->findvalue( '@oils_obj:fieldmapper', $remote_class_node );
                         $search_method =~ s/::/_/go;
 
-                        for my $remote_object ( @{$e->$search_method( { $key => $obj->$link_field } )} ) {
+                        for my $remote_object ( @{$e->$search_method( { $remote_field => $obj->$link_field } )} ) {
                             push @context_ous, $remote_object->$context_field;
                         }
                     } else {