split on pipes, not between every character; also, commit after an update
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 11 Mar 2008 18:52:51 +0000 (18:52 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 11 Mar 2008 18:52:51 +0000 (18:52 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@8975 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 30342f6..e19d707 100644 (file)
@@ -124,7 +124,7 @@ sub CRUD_action_object_permcheck {
     my $perm_field_value = $action_node->getAttribute('permission');
 
     if ($perm_field_value) {
-        my @perms = split '|', $action_node->getAttribute('permission');
+        my @perms = split '\|', $action_node->getAttribute('permission');
 
         my @context_ous;
         if ($action_node->getAttribute('global_required')) {
@@ -134,7 +134,7 @@ sub CRUD_action_object_permcheck {
             my $context_field_value = $action_node->getAttribute('context_field');
 
             if ($context_field_value) {
-                push @context_ous, $obj->$_ for ( split '|', $context_field_value );
+                push @context_ous, $obj->$_ for ( split '\|', $context_field_value );
             } else {  
                 for my $context_node ( $xpc->findnodes( "perm:context", $action_node ) ) {
                     my $context_field = $context_node->getAttribute('field');
@@ -154,7 +154,7 @@ sub CRUD_action_object_permcheck {
                             push @context_ous, $remote_object->$context_field;
                         }
                     } else {
-                        push @context_ous, $obj->$_ for ( split '|', $context_field );
+                        push @context_ous, $obj->$_ for ( split '\|', $context_field );
                     }
                 }
             }
@@ -184,7 +184,9 @@ sub CRUD_action_object_permcheck {
 
     return $obj if ($self->{action} eq 'retrieve');
 
-    return $e->session->request("open-ils.cstore.direct.$o_type.$self->{action}" => $obj )->gather(1);
+    my $val = $e->session->request("open-ils.cstore.direct.$o_type.$self->{action}" => $obj )->gather(1);
+
+    $e->commit;
 }
 
 sub search_permacrud {