Project

General

Profile

Bug #13050

Do not pass paths with /assets to helpers

Added by Daniel Lobato Garcia over 2 years ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Category:
Rails
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Sprockets 3 does not recommend that, and the new option 'config.assets.raise_runtime_errors` on development.rb will raise errors on development when doing it.
We only do it in one stylesheet and a helper, so fixing those let foreman load without these errors.


Related issues

Related to Foreman - Feature #4629: Add Patternfly support in foremanClosed2014-03-11
Related to Foreman - Refactor #12914: update rails configuration files to match to 4.1 syntaxClosed2015-12-22
Related to Katello - Bug #13096: Make Katello precompile bastion assetsClosed2016-01-09
Related to Foreman - Feature #13144: Enable assets.raise_runtime_errors in test environmentClosed2016-01-12

Associated revisions

Revision 1ba9650c (diff)
Added by Daniel Lobato Garcia over 2 years ago

Fixes #13050 - Do not pass paths with /assets to helpers

Sprockets 3 does not recommend that, and the new option
`config.assets.raise_runtime_errors` on development.rb will raise errors
on development when doing it.

We only do it in one stylesheet and a helper, so fixing those let
foreman load without these errors.

assets.rb now loads all plugin assets to ensure the assets are
precompiled.

History

#1 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Daniel Lobato Garcia
  • Pull request https://github.com/theforeman/foreman/pull/3031 added

#2 Updated by Marek Hulán over 2 years ago

Just for the record, if you see error like

Sprockets::Rails::Helper::AssetFilteredError

or

ActionView::Template::Error (Asset filtered out and will not be served: add `Rails.application.config.assets.precompile += %w( patternfly/spinner-lg.gif )` to `config/initializers/assets.rb` and restart your server):

it's likely caused by this bug.

#3 Updated by Dominic Cleal over 2 years ago

And if you see an error like this, it's also fixed by this PR (https://github.com/theforeman/foreman/pull/3031/files#r49106066 specifically):

/home/dcleal/.rvm/gems/ruby-2.0.0-p353@foreman/gems/actionpack-4.1.5/lib/action_dispatch/middleware/stack.rb:112:in `push': can't modify frozen Array (RuntimeError)
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p353@foreman/gems/actionpack-4.1.5/lib/action_dispatch/middleware/stack.rb:112:in `use'
        from /home/dcleal/code/foreman/foreman/config/initializers/assets.rb:73:in `block in <top (required)>'
        from /home/dcleal/code/foreman/foreman/config/initializers/assets.rb:71:in `each'
        from /home/dcleal/code/foreman/foreman/config/initializers/assets.rb:71:in `<top (required)>'

(on Rails startup with some plugins enabled)

Edit: filed instead as #13171, because the PR for this ticket was changed and no longer fixes it.

#4 Updated by Dominic Cleal over 2 years ago

  • Category set to Rails
  • Legacy Backlogs Release (now unused) set to 71

#5 Updated by Dominic Cleal over 2 years ago

  • Related to Feature #4629: Add Patternfly support in foreman added

#6 Updated by Dominic Cleal over 2 years ago

  • Related to Refactor #12914: update rails configuration files to match to 4.1 syntax added

#7 Updated by Daniel Lobato Garcia over 2 years ago

  • Related to Bug #13096: Make Katello precompile bastion assets added

#8 Updated by Daniel Lobato Garcia over 2 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#9 Updated by Dominic Cleal over 2 years ago

  • Related to Feature #13144: Enable assets.raise_runtime_errors in test environment added

Also available in: Atom PDF