Defect #44633
closedAbosolut include path in application.css
Description
The file app/assets/stylesheets/application.css starts with
this creates the wrong import when redmine is not installed in a root path (e.g. www.server1.int/redmine); the correct import should be
Updated by Giorgio Davanzo about 1 month ago
This was noticed in redmine 7.0.2
Updated by Marius BĂLTEANU 30 days ago
- Status changed from New to Needs feedback
- Assignee set to Giorgio Davanzo
You should set RAILS_RELATIVE_URL_ROOT variable when compiling the assets, please see RedmineInstall.
Updated by Giorgio Davanzo 30 days ago
Updated by Marius BĂLTEANU 20 days ago
Thanks for the feedback.
The @import url('/open-color.css') in the source file is expected: when the assets are compiled, Propshaft rewrites it to /redmine/assets/open-color-<digest>.css if RAILS_RELATIVE_URL_ROOT=/redmine is set, or to /assets/open-color-<digest>.css otherwise.
Could you please check:
- What exactly does the compiled
public/assets/application-*.csscontain:/assets/open-color-<digest>.css, or still/open-color.css? - Is the relative URL root also set for the process that runs Redmine (not only for the
assets:precompilecommand)? In production, Redmine automatically recompiles the assets on startup when it detects changes (for example after installing a plugin or theme), and that compilation uses the environment of the server process. - Does the log contain the warning
Unable to resolve '/open-color.css'?
You can also try bin/rails assets:clobber followed by RAILS_RELATIVE_URL_ROOT=/redmine bin/rails assets:precompile.
Updated by Giorgio Davanzo 20 days ago
I can tell you what I have now, after editing application.css; it should be noted that I just edited the file and everything works
1) application-*.css both point at /assets/open-color-<digest>.css
2) this might be the issue: I am using Apache with Phusion Passenger, and this was the config file:
<Location /redmine> RailsEnv production RackBaseURI /redmine Options -MultiViews PassengerFriendlyErrorPages on </Location>
Most likely this worked with olders version of it, while now it should read:
Updated by Marius BĂLTEANU 19 days ago
- Status changed from Needs feedback to Closed
- Resolution set to Invalid
Setting SetEnv RAILS_RELATIVE_URL_ROOT /redmine did the trick when Redmine automatically compiles the assets.
I'm closing this.