You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When users attempt to deprecate entries with sale agents who have an observed name but no authority record, an exception is raised:
A NoMethodError occurred in entries#deprecate:
undefined method `id' for nil:NilClass
app/models/entry.rb:221:in `block in decrement_counters'
app/models/entry.rb:220:in `each'
app/models/entry.rb:220:in `decrement_counters'
app/controllers/entries_controller.rb:538:in `block in deprecate'
app/controllers/entries_controller.rb:495:in `deprecate'
The problem can be corrected by skipping agents without an agent_id:
ifsalesale.sale_agents.map(&:agent).uniq.eachdo |sale_agent|
nextifsale_agent.blank?# skip if agent_id is null <= Add this lineName.decrement_counter(:sale_agents_count,sale_agent.id)objects.push(sale_agent)endend
The text was updated successfully, but these errors were encountered:
When users attempt to deprecate entries with sale agents who have an observed name but no authority record, an exception is raised:
The problem occurs here:
https://github.com/upenn-libraries/sdbmss/blob/master/app/models/entry.rb#L219-L224
The problem occurred with SDBM_ 8263, which has sale agents below. Note that the agent with
observed_name
'Llewellyn' has a nullagent_id
.The problem can be corrected by skipping agents without an
agent_id
:The text was updated successfully, but these errors were encountered: