Error with Recalls: Can't locate object method "workstation" via package "action::circulation" at CDBI.pm line 181

Bug #1657283 reported by Jason Etheridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

collab/phasefx/cdbi_fix @ working

commit d6b672b419796a681433cc082cdf6916bb4cb6f0
Author: Jason Etheridge <email address hidden>
Date: Tue Jan 17 16:39:58 2017 -0500

    Fix Can't locate object method "workstation" error

    When trying to utilize the Recall functionality, Evergreen would fail to update
    targeted circulations (truncate the due date, etc.) In the logs, we would have
    an error like this:

    [] open-ils.storage [ERR ::action.pm:1597:] Processing of hold failed:
    Can't locate object method "workstation" via package "action::circulation" at
    /usr/local/share/perl/5.14.2/OpenILS/Application/Storage/CDBI.pm line 181.

    We first tried adding the workstation column to Storage/CDBI/action.pm, but a
    similar message would then appear instead: Can't locate object method
    "checkin_workstation"

    This sidesteps the problem entirely.

    Thanks to Mike for the solution!

    Signed-off-by: Jason Etheridge <email address hidden>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI.pm b/Open-ILS/src/perlmods/lib/O
index d8391b8..d164251 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI.pm
@@ -178,7 +178,7 @@ sub to_fieldmapper {

     if (ref($obj)) {
         for my $field ( $fm->real_fields ) {
- $fm->$field( ''.$obj->$field ) if defined $obj->$field;
+ $fm->$field( ''.$obj->$field ) if $obj->find_column($field) && defined $obj->$field;
         }
     }

Tags: pullrequest
Revision history for this message
Jason Etheridge (phasefx) wrote :
Erica Rohlfs (erohlfs)
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Erica Rohlfs (erohlfs) wrote :

Confirmed in EG 2.9 and 2.11.

Revision history for this message
Mike Rylander (mrylander) wrote :

Merged for great justice. Thanks, Jason!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.