uvalib / tracksys

UVA Library Digitization Services workflow and repository management tool.
8 stars 2 forks source link

"Couldn't find Unit without an ID" errors on :start_manual_upload_to_archive_production #180

Closed sdm7g closed 10 years ago

sdm7g commented 10 years ago

app/processors/send_unit_to_archive_processor.rb:126

non-tracksys managed data does not have a unit_id. This line raises an error when unit_id is nil:

    Unit.find(@unit_id)

That code should probably be:

if @errors.eql?(0)
  # Try to log where this unit is archived
  archival_location="StorNext"
  unit = unit_id and Unit.find(@unit_id)
  if unit && unit.archive
    if unit.archive.respond_to?(:name)
      archival_location=unit.archive.name
    end
  end
sdm7g commented 10 years ago

Fixed in production-new branch. ( This and some earlier changes of Matt's need to be merged back into master as well. )

commit 4353bfa7bea6451b500c99d46193ab6018b63a01 Author: Steve Majewski sdm7g@virginia.edu Date: Mon May 12 15:24:48 2014 -0400

Issue #180 -- https://github.com/uvalib-dcs/tracksys/issues/180
guard Unit.find for nil unit case