projectblacklight / blacklight

Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr) index.
http://projectblacklight.org/
Other
758 stars 257 forks source link

Blacklight 5.4.0.rc1, bookmarks with marc #884

Closed jrochkind closed 10 years ago

jrochkind commented 10 years ago

blacklight-5.4.0.rc1

/blacklight_marc-19a26074dfed (which should be head of blacklight54compat branch of blacklight-marc)

When I view /bookmarks with any items in them at all, in my local app, I get an exception:

Showing /Users/jrochkind/.gem/ruby/1.9.3/bundler/gems/blacklight_marc-19a26074dfed/app/views/bookmarks/_refworks.html.erb where line #3 raised:

No route matches {:action=>"show", :controller=>"catalog", :format=>"refworks_marc_txt", :id=>nil} missing required keys: [:id]

  <% if @document_list.any? {|d| d.exports_as? :refworks_marc_txt } %>
    <li class="refworks">
      <%= link_to t('blacklight.tools.refworks'), refworks_export_url(url: bookmarks_export_url(:refworks_marc_txt, params_for_search)), :class => "btn btn-default", :id => "refworksLink" %>
    </li>
  <% end %>

application trace is just one line:

 app/helpers/local_catalog_helper.rb:44:in `refworks_export_url'

full stack trace:

actionpack (4.1.0) lib/action_dispatch/journey/formatter.rb:39:in `generate'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:597:in `generate'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:627:in `generate'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:663:in `url_for'
actionpack (4.1.0) lib/action_dispatch/routing/url_for.rb:155:in `url_for'
actionview (4.1.0) lib/action_view/routing_url_for.rb:83:in `url_for'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:228:in `call'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:179:in `call'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:268:in `block (2 levels) in define_url_helper'
app/helpers/local_catalog_helper.rb:44:in `refworks_export_url'
/Users/jrochkind/.gem/ruby/1.9.3/bundler/gems/blacklight_marc-19a26074dfed/app/views/bookmarks/_refworks.html.erb:3:in `___sers_jrochkind__gem_ruby_______bundler_gems_blacklight_marc___a_____dfed_app_views_bookmarks__refworks_html_erb__3838765329950545840_70324273439140'
actionview (4.1.0) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.0) lib/active_support/notifications.rb:161:in `instrument'
actionview (4.1.0) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.0) lib/action_view/template.rb:143:in `render'
actionview (4.1.0) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
actionview (4.1.0) lib/action_view/renderer/partial_renderer.rb:279:in `block in render'
actionview (4.1.0) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.0) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.0) lib/action_view/renderer/partial_renderer.rb:278:in `render'
actionview (4.1.0) lib/action_view/renderer/renderer.rb:47:in `render_partial'
actionview (4.1.0) lib/action_view/helpers/rendering_helper.rb:35:in `render'
/Users/jrochkind/.gem/ruby/1.9.3/bundler/gems/blacklight_marc-19a26074dfed/app/views/bookmarks/_marc_tools.html.erb:2:in `___sers_jrochkind__gem_ruby_______bundler_gems_blacklight_marc___a_____dfed_app_views_bookmarks__marc_tools_html_erb___3116262495141033718_70324273422760'
actionview (4.1.0) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.0) lib/active_support/notifications.rb:161:in `instrument'
actionview (4.1.0) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.0) lib/action_view/template.rb:143:in `render'
actionview (4.1.0) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
actionview (4.1.0) lib/action_view/renderer/partial_renderer.rb:279:in `block in render'
actionview (4.1.0) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.0) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.0) lib/action_view/renderer/partial_renderer.rb:278:in `render'
actionview (4.1.0) lib/action_view/renderer/renderer.rb:47:in `render_partial'
actionview (4.1.0) lib/action_view/helpers/rendering_helper.rb:35:in `render'
blacklight (5.4.0.rc1) app/helpers/blacklight/catalog_helper_behavior.rb:210:in `render_marc_tools'
blacklight (5.4.0.rc1) app/views/bookmarks/_tools.html.erb:10:in `___sers_jrochkind__gem_ruby_______gems_blacklight_______rc__app_views_bookmarks__tools_html_erb___1244661966389796878_70324216025220'
actionview (4.1.0) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.0) lib/active_support/notifications.rb:161:in `instrument'
actionview (4.1.0) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.0) lib/action_view/template.rb:143:in `render'
actionview (4.1.0) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
actionview (4.1.0) lib/action_view/renderer/partial_renderer.rb:279:in `block in render'
actionview (4.1.0) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.0) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.0) lib/action_view/renderer/partial_renderer.rb:278:in `render'
actionview (4.1.0) lib/action_view/renderer/renderer.rb:47:in `render_partial'
actionview (4.1.0) lib/action_view/helpers/rendering_helper.rb:35:in `render'
blacklight (5.4.0.rc1) app/views/bookmarks/index.html.erb:14:in `___sers_jrochkind__gem_ruby_______gems_blacklight_______rc__app_views_bookmarks_index_html_erb___312136948453781791_70324255714000'
actionview (4.1.0) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.0) lib/active_support/notifications.rb:161:in `instrument'
actionview (4.1.0) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.0) lib/action_view/template.rb:143:in `render'
actionview (4.1.0) lib/action_view/renderer/template_renderer.rb:55:in `block (2 levels) in render_template'
actionview (4.1.0) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.0) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.0) lib/action_view/renderer/template_renderer.rb:54:in `block in render_template'
actionview (4.1.0) lib/action_view/renderer/template_renderer.rb:62:in `render_with_layout'
actionview (4.1.0) lib/action_view/renderer/template_renderer.rb:53:in `render_template'
actionview (4.1.0) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionview (4.1.0) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.1.0) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.1.0) lib/action_view/rendering.rb:99:in `_render_template'
actionpack (4.1.0) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.1.0) lib/action_view/rendering.rb:82:in `render_to_body'
actionpack (4.1.0) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.1.0) lib/action_controller/metal/renderers.rb:32:in `render_to_body'
actionpack (4.1.0) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.1.0) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.1.0) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/opt/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
activesupport (4.1.0) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.1.0) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (4.1.0) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.1.0) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (4.1.0) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.0) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.0) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.0) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.0) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.0) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.0) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.0) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.1.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.0) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:676:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.0) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.0) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.0) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.0.2) lib/quiet_assets.rb:18:in `call_with_quiet_assets'
actionpack (4.1.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.0) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.0) lib/rails/engine.rb:514:in `call'
railties (4.1.0) lib/rails/application.rb:144:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/opt/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/opt/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/opt/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
jrochkind commented 10 years ago

if I remove my override, things SEEM to be good. I can't fully test refworks export on :3000 on my local machine (firewalls firewalls for callback), I'm going to have to actually deploy to a demo server to fully test it.

sorry for the report involving just my local overrides that had to be updated for new BL.

jrochkind commented 10 years ago

okay, after fixing that issue, /bookmarks displays. EndNote export works.

But I'm afraid trying to test real live Refworks export against live Refworks, it is NOT working.

Refworks is giving me an error message, it's usual vague "Import Failed." I will debug further, but may not be able to get to it until Monday.

jrochkind commented 10 years ago

Okay, the callback URL being given to refworks is returning a 406.

Refworks URL:

http://www.refworks.com/express/expressimport.asp?vendor=JH+Libraries&filter=MARC+Format&encoding=65001&url=https%3A%2F%2Fblacklight.library.jhu.edu%2Fblacklight_upgrade%2Fbookmarks.format%3Fencrypted_user_id%3DNVBWa0piQ1ZLeE5ZckgwYkI3TVJxZEJ6b1hFSHhEcW9KUGdZbzQrNEsxVkhmVXJQUWozbEVaOFpzNitmQ0RuNnVlRStGRUt1dWl6T1NTcTN2QXk2alE9PS0tZ0dmbXJzaHlkQ0Fzalovd2pJKytNQT09--60574c8ac03fae4b4ea50192eea7be40c6ddb3fb

Unescaped callback URL:

https://blacklight.library.jhu.edu/blacklight_upgrade/bookmarks.format?encrypted_user_id=NVBWa0piQ1ZLeE5ZckgwYkI3TVJxZEJ6b1hFSHhEcW9KUGdZbzQrNEsxVkhmVXJQUWozbEVaOFpzNitmQ0RuNnVlRStGRUt1dWl6T1NTcTN2QXk2alE9PS0tZ0dmbXJzaHlkQ0Fzalovd2pJKytNQT09--60574c8ac03fae4b4ea50192eea7be40c6ddb3fb

Which results in a 406 with a blank body. Let me check the error logs on that one...

[2014-04-10 16:45:27.756] FATAL  ActionController::UnknownFormat (ActionController::UnknownFormat):
  actionpack (4.1.0) lib/action_controller/metal/mime_responds.rb:440:in `retrieve_collector_from_mimes'
  actionpack (4.1.0) lib/action_controller/metal/mime_responds.rb:256:in `respond_to'
  blacklight (5.4.0.rc1) app/controllers/bookmarks_controller.rb:31:in `index'
jrochkind commented 10 years ago

Ah, the problem of course is that it's giving Refworks a callback url with bookmarks.format, that should be bookmarks.refworks_marc_txt.

I suspect somewhere there's a literal format that was supposed to be an interpolated varialbe #{format] or something like that. But I haven't tracked down where that is in the code yet (not even sure which gem it's in), and am prob about to leave for the day.

cbeer commented 10 years ago

Thanks. Fixed in 8ed1ba71c98d8e184f06be57ba36bbeae463c40b.

jrochkind commented 10 years ago

Thanks! is there a new rc or other release, or to use/test this fix should I be pointing at github master?

cbeer commented 10 years ago

blacklight master and the blacklight-marc pull request.