Skip to content

Commit

Permalink
Merge pull request #618 from avalonmediasystem/v4.0.x
Browse files Browse the repository at this point in the history
v4.0.1
  • Loading branch information
paclough committed Sep 19, 2015
2 parents 12f4f33 + 5d52708 commit 9f1c30d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions app/controllers/bookmarks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/media_objects_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
end

module Avalon
VERSION = '4.0'
VERSION = '4.0.1'
class MissingUserId < Exception; end

class Application < Rails::Application
Expand Down

0 comments on commit 9f1c30d

Please sign in to comment.