Re: [Blacklight-development] Librarian view issue

28 views
Skip to first unread message

Chris Beer

unread,
May 14, 2013, 5:41:09 PM5/14/13
to blacklight-...@googlegroups.com
In your SolrDocument model (./app/models/solr_document.rb), which looks something like:

https://github.com/projectblacklight/blacklight/blob/master/lib/generators/blacklight/templates/solr_document.rb#L10

Is your marc_format_type field set to match whatever format you're storing in the solr field given in the marc_source_field parameter?

I think somewhere in there, we've changed the default from marc21 to marcxml, and maybe bad things happen if you have one but declare the other? Just a guess.



On 10 May, 2013, at 13:53 , Michael Levy <ml...@ushmm.org> wrote:

I have Blacklight 4.2.1 installed connecting to a Solr 3.3.0, the same version powering our current Blacklight 3.5.0 version. It's working well as a demo/development site, with a few issues I will probably be asking the community's help with. Here is one, with Librarian View. Some of our records are MARC and some are not.

I imagine it's related to this discussion also. 

Do I need to do something to get the MARC record type registered to display the Librarian View?

I posted something 13 months ago that is pretty much the same issue but I know I'm not doing something right.

What I am seeing now is the following error. Any help appreciated, thanks!

Started GET "/excat/catalog/bib230949/librarian_view?_=1368218680060" for 10.3.3.37 at 2013-05-10 16:44:48 -0400
Processing by CatalogController#librarian_view as JS
  Parameters: {"_"=>"1368218680060", "id"=>"bib230949"}
  Rendered /data/home/www/.rvm/gems/ruby-1.9.3-p0@rails321/gems/blacklight_google_analytics-0.0.1.pre3/app/views/layouts/_google_analytics.html.erb (4.3ms)
  Rendered /data/home/www/.rvm/gems/ruby-1.9.3-p0@rails321/gems/blacklight-4.2.1/app/views/catalog/_marc_view.html.erb (48.7ms)
  Rendered /data/home/www/.rvm/gems/ruby-1.9.3-p0@rails321/gems/blacklight-4.2.1/app/views/catalog/librarian_view.html.erb (67.5ms)
Completed 500 Internal Server Error in 903ms

ActionView::Template::Error (undefined method `find_all' for nil:NilClass):
    1: <div id="marc_view">
    2:   <% fields = @document.to_marc.find_all{|f| ('000'..'999') === f.tag }  %>
    3:   <div class="field"><%= t('blacklight.search.librarian_view.leader', :leader => @document.to_marc.leader) %></div>
    4:   <%- fields.each do |field| -%>
    5:  <%- unless field.tag.to_s == "940" -%>
  /datablacklight (4.2.1) app/views/catalog/_marc_view.html.erb:2:in `__data_home_www__rvm_gems_ruby_______p__rails____gems_blacklight_______app_views_catalog__marc_view_html_erb___4250666032643182248_31700380'
  actionpack (3.2.11) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.11) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.11) lib/action_view/template.rb:143:in `render'
  actionpack (3.2.11) lib/action_view/renderer/partial_renderer.rb:265:in `render_partial'
  actionpack (3.2.11) lib/action_view/renderer/partial_renderer.rb:238:in `block in render'
  actionpack (3.2.11) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (3.2.11) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.11) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.11) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionpack (3.2.11) lib/action_view/renderer/partial_renderer.rb:237:in `render'
  actionpack (3.2.11) lib/action_view/renderer/renderer.rb:41:in `render_partial'
  actionpack (3.2.11) lib/action_view/helpers/rendering_helper.rb:27:in `render'
  /datablacklight (4.2.1) app/views/catalog/librarian_view.html.erb:7:in `__data_home_www__rvm_gems_ruby_______p__rails____gems_blacklight_______app_views_catalog_librarian_view_html_erb___2603231063057616525_8126900'
  actionpack (3.2.11) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.11) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.11) lib/action_view/template.rb:143:in `render'
  actionpack (3.2.11) lib/action_view/renderer/template_renderer.rb:47:in `block (2 levels) in render_template'
  actionpack (3.2.11) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (3.2.11) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.11) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.11) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionpack (3.2.11) lib/action_view/renderer/template_renderer.rb:46:in `block in render_template'
  actionpack (3.2.11) lib/action_view/renderer/template_renderer.rb:54:in `render_with_layout'
  actionpack (3.2.11) lib/action_view/renderer/template_renderer.rb:45:in `render_template'
  actionpack (3.2.11) lib/action_view/renderer/template_renderer.rb:18:in `render'
  actionpack (3.2.11) lib/action_view/renderer/renderer.rb:36:in `render_template'
  actionpack (3.2.11) lib/action_view/renderer/renderer.rb:17:in `render'
  actionpack (3.2.11) lib/abstract_controller/rendering.rb:110:in `_render_template'
  actionpack (3.2.11) lib/action_controller/metal/streaming.rb:225:in `_render_template'
  actionpack (3.2.11) lib/abstract_controller/rendering.rb:103:in `render_to_body'
  actionpack (3.2.11) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
  actionpack (3.2.11) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
  actionpack (3.2.11) lib/abstract_controller/rendering.rb:88:in `render'
  actionpack (3.2.11) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
  activesupport (3.2.11) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
  /home/www/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
  activesupport (3.2.11) lib/active_support/core_ext/benchmark.rb:5:in `ms'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
  activerecord (3.2.11) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:39:in `render'
  /datablacklight (4.2.1) lib/blacklight/catalog.rb:184:in `block (2 levels) in librarian_view'
  actionpack (3.2.11) lib/action_controller/metal/mime_responds.rb:196:in `call'
  actionpack (3.2.11) lib/action_controller/metal/mime_responds.rb:196:in `respond_to'
  /datablacklight (4.2.1) lib/blacklight/catalog.rb:182:in `librarian_view'
  actionpack (3.2.11) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.11) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.11) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.11) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.11) lib/active_support/callbacks.rb:458:in `_run__924785846585905537__process_action__2027736397495980305__callbacks'
  activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.11) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.11) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.11) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.11) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.11) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.11) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.11) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.11) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.11) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.11) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.11) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:73:in `call'
  actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:36:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:601:in `call'
  warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.1) lib/warden/manager.rb:34:in `catch'
  warden (1.2.1) lib/warden/manager.rb:34:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.11) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.11) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `_run__3062314633197648553__call__496155940866859456__callbacks'
  activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/reloader.rb:65:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.11) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.11) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.11) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.11) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/static.rb:62:in `call'
  railties (3.2.11) lib/rails/engine.rb:479:in `call'
  railties (3.2.11) lib/rails/application.rb:223:in `call'
  railties (3.2.11) lib/rails/railtie/configurable.rb:30:in `method_missing'
  passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
  passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
  passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
  passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
  passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
  passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in `safe_fork'
  passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:180:in `start'
  passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
  passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
  passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
  <internal:prelude>:10:in `synchronize'
  passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  passenger (3.0.11) helper-scripts/passenger-spawn-server:99:in `<main>'


  Rendered /home/www/.rvm/gems/ruby-1.9.3-p0@rails321/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.3ms)
  Rendered /home/www/.rvm/gems/ruby-1.9.3-p0@rails321/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.3ms)
  Rendered /home/www/.rvm/gems/ruby-1.9.3-p0@rails321/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (15.4ms)




--
You received this message because you are subscribed to the Google Groups "Blacklight Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blacklight-develo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Levy, Michael

unread,
May 15, 2013, 12:52:52 PM5/15/13
to blacklight-...@googlegroups.com
Thanks so much, Chris.

Changing app/models/solr_document.rb from
  extension_parameters[:marc_format_type] = :marcxml
to
  extension_parameters[:marc_format_type] = :marc21

fixed the problem.

BTW, I don't know why my BL 3.5 production version is working OK. That and this test BL 4.2.1 version are pointing to the same Solr instance and the values in the Solr marc_display field is in marc21
Reply all
Reply to author
Forward
0 new messages