Deal with moved publish_fieldmapper() method
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 20 Aug 2012 18:22:06 +0000 (14:22 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 21 Sep 2012 15:06:57 +0000 (11:06 -0400)
This is a companion commit to
fac45ab9b1cb8924 / Move Fieldmapper API call to Application.pm

Without it, Flattener and Action/Trigger stop working with errors like
this:

[Mon Aug 20 13:50:18 2012] [error] [client XXX.XXX.XXX.XXX] Exception:
OpenSRF::EX::ERROR 2012-08-20T13:50:18 main -e:0 System ERROR:
Exception: OpenSRF::DomainObject::oilsMethodException
2012-08-20T13:50:18 OpenSRF::AppRequest
/usr/local/share/perl/5.10.1/OpenSRF/AppSession.pm:1064 <500>   *** Call
to [open-ils.fielder.flattened_search.execute.atomic] failed for session
[1345485018.767884163.96534353976], thread trace [1]:\nNo field by the
name publish_fieldmapper in Fieldmapper! at
/usr/local/share/perl/5.10.1/OpenILS/Utils/Fieldmapper.pm line
270.\n\n\n\n, referer:
http://XXXXXXX/eg/conify/global/actor/search_filter_group

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Flattener.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm

index 8bc8eda..c967247 100644 (file)
@@ -20,7 +20,7 @@ $Data::Dumper::Indent = 0;
 sub _fm_link_from_class {
     my ($class, $field) = @_;
 
-    return Fieldmapper->publish_fieldmapper->{$class}{links}{$field};
+    return OpenILS::Application->publish_fieldmapper->{$class}{links}{$field};
 }
 
 sub _flattened_search_single_flesh_wad {
index 2f28416..24488e8 100644 (file)
@@ -369,15 +369,15 @@ __PACKAGE__->register_method(
  
 sub _fm_hint_by_class {
     my $class = shift;
-    return Fieldmapper->publish_fieldmapper->{$class}->{hint};
+    return OpenILS::Application->publish_fieldmapper->{$class}->{hint};
 }
 
 sub _fm_class_by_hint {
     my $hint = shift;
 
     my ($class) = grep {
-        Fieldmapper->publish_fieldmapper->{$_}->{hint} eq $hint
-    } keys %{ Fieldmapper->publish_fieldmapper };
+        OpenILS::Application->publish_fieldmapper->{$_}->{hint} eq $hint
+    } keys %{ OpenILS::Application->publish_fieldmapper };
 
     return $class;
 }
index 1aca73e..0f52b73 100644 (file)
@@ -484,8 +484,8 @@ sub _fm_class_by_hint {
     my $hint = shift;
 
     my ($class) = grep {
-        Fieldmapper->publish_fieldmapper->{$_}->{hint} eq $hint
-    } keys %{ Fieldmapper->publish_fieldmapper };
+        OpenILS::Application->publish_fieldmapper->{$_}->{hint} eq $hint
+    } keys %{ OpenILS::Application->publish_fieldmapper };
 
     return $class;
 }
@@ -530,15 +530,15 @@ sub _object_by_path {
 
     my $step = shift(@$path);
 
-    my $fhint = Fieldmapper->publish_fieldmapper->{$context->class_name}{links}{$step}{class};
+    my $fhint = OpenILS::Application->publish_fieldmapper->{$context->class_name}{links}{$step}{class};
     my $fclass = $self->_fm_class_by_hint( $fhint );
 
     OpenSRF::EX::ERROR->throw(
         "$step is not a field on ".$context->class_name."  Please repair the environment.")
         unless $fhint;
 
-    my $ffield = Fieldmapper->publish_fieldmapper->{$context->class_name}{links}{$step}{key};
-    my $rtype = Fieldmapper->publish_fieldmapper->{$context->class_name}{links}{$step}{reltype};
+    my $ffield = OpenILS::Application->publish_fieldmapper->{$context->class_name}{links}{$step}{key};
+    my $rtype = OpenILS::Application->publish_fieldmapper->{$context->class_name}{links}{$step}{reltype};
 
     my $meth = 'retrieve_';
     my $multi = 0;
@@ -572,7 +572,7 @@ sub _object_by_path {
             $obj = $_object_by_path_cache{$def_id}{$str_path}{$step}{$ffield}{$lval} ||
                 (
                     (grep /cstore/, @{
-                        Fieldmapper->publish_fieldmapper->{$fclass}{controller}
+                        OpenILS::Application->publish_fieldmapper->{$fclass}{controller}
                     }) ? $ed : ($red ||= new_rstore_editor(xact=>1))
                 )->$meth( ($multi) ? { $ffield => $lval } : $lval);