Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

NoMethodError: undefined method `to_semantic_values' for nil:NilClass #2044

Open
pgwillia opened this issue Aug 21, 2020 · 1 comment
Open
Labels

Comments

@pgwillia
Copy link
Member

View details in Rollbar: https://rollbar.com/ualbertalib/discovery/items/285/


NoMethodError: undefined method `to_semantic_values' for nil:NilClass
  File "/var/www/sites/blacklight/app/models/record_mailer.rb", line 6, in email_record
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/abstract_controller/base.rb", line 198, in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/abstract_controller/callbacks.rb", line 20, in block in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/callbacks.rb", line 88, in __run_callbacks__
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/callbacks.rb", line 778, in _run_process_action_callbacks
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/callbacks.rb", line 81, in run_callbacks
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/abstract_controller/callbacks.rb", line 19, in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/abstract_controller/base.rb", line 137, in process
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionview-4.2.11.3/lib/action_view/rendering.rb", line 30, in process
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionmailer-4.2.11.3/lib/action_mailer/base.rb", line 596, in block in process
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/notifications.rb", line 164, in block in instrument
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/notifications/instrumenter.rb", line 20, in instrument
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/notifications.rb", line 164, in instrument
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionmailer-4.2.11.3/lib/action_mailer/base.rb", line 593, in process
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionmailer-4.2.11.3/lib/action_mailer/base.rb", line 584, in initialize
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionmailer-4.2.11.3/lib/action_mailer/message_delivery.rb", line 25, in new
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionmailer-4.2.11.3/lib/action_mailer/message_delivery.rb", line 25, in __getobj__
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionmailer-4.2.11.3/lib/action_mailer/message_delivery.rb", line 34, in message
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionmailer-4.2.11.3/lib/action_mailer/message_delivery.rb", line 85, in deliver_now
  File "/var/www/sites/blacklight/lib/blacklight/catalog.rb", line 244, in email_action
  File "/var/www/sites/blacklight/vendor/cache/blacklight-0a1073122697/lib/blacklight/catalog/component_configuration.rb", line 45, in block in add_show_tools_partial
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_controller/metal/implicit_render.rb", line 4, in send_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/abstract_controller/base.rb", line 198, in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_controller/metal/rendering.rb", line 10, in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/abstract_controller/callbacks.rb", line 20, in block in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/callbacks.rb", line 117, in call
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/callbacks.rb", line 555, in block (2 levels) in compile
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/callbacks.rb", line 505, in call
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/callbacks.rb", line 92, in __run_callbacks__
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/callbacks.rb", line 778, in _run_process_action_callbacks
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/callbacks.rb", line 81, in run_callbacks
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/abstract_controller/callbacks.rb", line 19, in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_controller/metal/rescue.rb", line 29, in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_controller/metal/instrumentation.rb", line 32, in block in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/notifications.rb", line 164, in block in instrument
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/notifications/instrumenter.rb", line 20, in instrument
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/notifications.rb", line 164, in instrument
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_controller/metal/instrumentation.rb", line 30, in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_controller/metal/params_wrapper.rb", line 250, in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/activerecord-4.2.11.3/lib/active_record/railties/controller_runtime.rb", line 18, in process_action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/abstract_controller/base.rb", line 137, in process
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionview-4.2.11.3/lib/action_view/rendering.rb", line 30, in process
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_controller/metal.rb", line 196, in dispatch
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_controller/metal/rack_delegation.rb", line 13, in dispatch
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_controller/metal.rb", line 237, in block in action
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_dispatch/routing/route_set.rb", line 74, in dispatch
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_dispatch/routing/route_set.rb", line 43, in serve
  File "/var/www/sites/blacklight/vendor/ruby/2.5.0/gems/actionpack-4.2.11.3/lib/action_dispatch/journey/router.rb", line 43, in block in serve
  F
@pgwillia
Copy link
Member Author

pgwillia commented Aug 21, 2020

# Only works for documents with a #to_marc right now.
class RecordMailer < ActionMailer::Base
def email_record(documents, details, url_gen_params)
# raise ArgumentError.new("RecordMailer#email_record only works with documents with a #to_marc") unless document.respond_to?(:to_marc)
subject = "From University of Alberta Library: #{documents.first.to_semantic_values[:title].first}"
@count = documents.length
@documents = documents
@message = details[:message]
@call = details[:call]
@location = details[:location]
@url_gen_params = url_gen_params
mail(to: details[:to], subject: subject, from: '[email protected]')
end

@pgwillia pgwillia added the bug label Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant