From 8dd49836645904933b5ba3ef382aac7b61791ef6 Mon Sep 17 00:00:00 2001 From: Chris Colvard Date: Wed, 9 Sep 2015 11:32:50 -0400 Subject: [PATCH 1/3] Don't assume lti is configured --- app/helpers/media_objects_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/media_objects_helper.rb b/app/helpers/media_objects_helper.rb index bddd626ba0..9655ba54ad 100644 --- a/app/helpers/media_objects_helper.rb +++ b/app/helpers/media_objects_helper.rb @@ -146,9 +146,9 @@ def structure_html section, index, show_progress segment: section.pid, is_video: section.is_video?, share_link: share_link_for(section), - lti_share_link: user_omniauth_callback_url(action: 'lti', target_id: section), native_url: pid_section_media_object_path(@mediaobject, section.pid) } + data[:lti_share_link] = user_omniauth_callback_url(action: 'lti', target_id: section) if Avalon::Authentication::Providers.any? {|p| p[:provider] == :lti } duration = section.duration.blank? ? '' : " (#{milliseconds_to_formatted_time(section.duration.to_i)})" # If there is no structural metadata associated with this masterfile return the stream info From ce78ba75d2febe2fd3f8dff5d880d4a770b6aa8d Mon Sep 17 00:00:00 2001 From: Chris Colvard Date: Wed, 9 Sep 2015 11:38:14 -0400 Subject: [PATCH 2/3] Bump version to 4.0.1 --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 7e3451dd18..e584db735b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -11,7 +11,7 @@ end module Avalon - VERSION = '4.0' + VERSION = '4.0.1' class MissingUserId < Exception; end class Application < Rails::Application From 5d52708012ef4a398cbc0741d54bfe61a93fb81f Mon Sep 17 00:00:00 2001 From: Chris Colvard Date: Fri, 18 Sep 2015 17:25:45 -0400 Subject: [PATCH 3/3] Fix for issue with lucene query parser missing from VM --- app/controllers/bookmarks_controller.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/controllers/bookmarks_controller.rb b/app/controllers/bookmarks_controller.rb index 38c57de6dd..ec6a1638f9 100644 --- a/app/controllers/bookmarks_controller.rb +++ b/app/controllers/bookmarks_controller.rb @@ -14,6 +14,10 @@ class BookmarksController < CatalogController include Blacklight::Bookmarks + + #HACK next two lines are a hack for problems in the puppet VM tomcat/solr + BookmarksController.search_params_logic -= [:add_query_to_solr] + BookmarksController.search_params_logic += [:rewrite_bookmarks_search] blacklight_config.show.document_actions[:email].if = false if blacklight_config.show.document_actions[:email] blacklight_config.show.document_actions[:citation].if = false if blacklight_config.show.document_actions[:citation] @@ -30,6 +34,23 @@ class BookmarksController < CatalogController before_filter :verify_permissions, only: :index + #HACK next two methods are a hack for problems in the puppet VM tomcat/solr + def rewrite_bookmarks_search(solr_parameters, user_parameters) + solr_parameters[:q] = "id:(#{ Array(user_parameters[:q][:id]).map { |x| solr_escape(x) }.join(' OR ')})" + end + + def solr_escape val, options={} + options[:quote] ||= '"' + unless val =~ /^[a-zA-Z0-9$_\-\^]+$/ + val = options[:quote] + + # Yes, we need crazy escaping here, to deal with regexp esc too! + val.gsub("'", "\\\\\'").gsub('"', "\\\\\"") + + options[:quote] + end + return val + end + + def user_can? action @valid_user_actions.include? action end