Project

General

Profile

Actions

Defect #44633

closed

Abosolut include path in application.css

Defect #44633: Abosolut include path in application.css

Added by Giorgio Davanzo about 1 month ago. Updated 19 days ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-
Resolution:
Invalid
Affected version:

Description

The file app/assets/stylesheets/application.css starts with

@import url('/open-color.css');

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

@import url('open-color.css');

Updated by Giorgio Davanzo about 1 month ago Actions #1

This was noticed in redmine 7.0.2

Updated by Marius BĂLTEANU 30 days ago Actions #2

  • 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 Actions #3

yep, the variable was set when compiling the issue - still, the issue was there.

RAILS_RELATIVE_URL_ROOT=/redmine

Updated by Marius BĂLTEANU 20 days ago Actions #4

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:

  1. What exactly does the compiled public/assets/application-*.css contain: /assets/open-color-<digest>.css, or still /open-color.css?
  2. Is the relative URL root also set for the process that runs Redmine (not only for the assets:precompile command)? 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.
  3. 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 Actions #5

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:

<Location /redmine>
    RailsEnv production
    PassengerBaseURI /redmine
    SetEnv RAILS_RELATIVE_URL_ROOT /redmine
    Options -MultiViews
    PassengerFriendlyErrorPages on
</Location>

Updated by Marius BĂLTEANU 19 days ago Actions #6

  • 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.

Actions

Also available in: PDF Atom