Blacklight Plugin

local application_controller needs require_dependency instead of require

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.5
  • Component/s: None
  • Description:
    Hide
    The template installer adds a line to your local application_controller:

    "require '#{install_path}/app/controllers/application_controller.rb'"

    That results in double-loading of the BL core ApplicationController, causing before_filters to be applied twice, causing double-listing of JS and CSS using the new html_head stuff.

    Changing this to require_dependency instead of require appears to fix the problem.

    Longer term, this stuff is REALLY confusing, and we probably want to find a simpler way to do it, perhaps using an explicit differently-named module or class that is explicitly include'd or inherited by the local application_controller, instead of relying on confusing Engines-style mix-in magic. Unless Rails 3.0 makes this stuff less confusing with it's attention to Engines.
    Show
    The template installer adds a line to your local application_controller: "require '#{install_path}/app/controllers/application_controller.rb'" That results in double-loading of the BL core ApplicationController, causing before_filters to be applied twice, causing double-listing of JS and CSS using the new html_head stuff. Changing this to require_dependency instead of require appears to fix the problem. Longer term, this stuff is REALLY confusing, and we probably want to find a simpler way to do it, perhaps using an explicit differently-named module or class that is explicitly include'd or inherited by the local application_controller, instead of relying on confusing Engines-style mix-in magic. Unless Rails 3.0 makes this stuff less confusing with it's attention to Engines.

Activity

Hide
Jonathan Rochkind added a comment - 05/May/10 9:20 AM
Okay, change committed for now. Changed the require to require_dependency in the template.rb installer.

Necessary to keep it from messing up the new html_head stuff. If this isn't optimal, some other solution can be found later.
Show
Jonathan Rochkind added a comment - 05/May/10 9:20 AM Okay, change committed for now. Changed the require to require_dependency in the template.rb installer. Necessary to keep it from messing up the new html_head stuff. If this isn't optimal, some other solution can be found later.

People

Dates

  • Created:
    04/May/10 10:33 AM
    Updated:
    05/May/10 9:20 AM
    Resolved:
    05/May/10 9:20 AM