Browse files

re CODEBASE-328 - modified the engine so that blacklight initializati…

…on will not be run unless in server mode - before this it was checking to see of solr.yaml existed, and if so, it assumed you were doing an installation or rake task and did not initialize blacklight. A far cleaner apprach is now in place which checks if this is a 'rails server' startup and if so, then executes the init for Blacklight.
  • Loading branch information...
1 parent b94807b commit a66ac6346fbd9140b84afc17e25c39c2f69d5152 Dan Funk committed May 13, 2011
Showing with 8 additions and 7 deletions.
  1. +1 −1 VERSION
  2. +2 −1 lib/blacklight/catalog.rb
  3. +5 −5 lib/blacklight/engine.rb
@@ -1 +1 @@
@@ -1,10 +1,11 @@
module Blacklight::Catalog
extend ActiveSupport::Concern
- include Blacklight::SolrHelper
# The following code is executed when someone includes blacklight::catalog in their
# own controller.
included do
+ include Blacklight::SolrHelper
before_filter :search_session, :history_session
before_filter :delete_or_assign_search_session_params, :only => :index
after_filter :set_additional_search_session_values, :only=>:index
@@ -15,11 +15,11 @@ class Engine < Rails::Engine
# innitilization process.
# See:
initializer 'blacklight.init', :after=> :disable_dependency_loading do |app|
- # Note, check for configuration files before calling init,
- # otherwise we can't generate these files with the Generator
- # and we can't tell at this point if we are begin run as a generator
- # or not (at least, I didn't see a way)
- Blacklight.init if File.exists?(Blacklight.solr_file)
+ # Check for a blacklight_install envrionment variable - if set then blacklight
+ # is actively being installed and we should not attempt an init at this time.
+ if defined?(Rails::Server)
+ Blacklight.init
+ end
# This makes our rake tasks visible.

0 comments on commit a66ac63

Please sign in to comment.