Ltr stylesheets are missing


(Simon Cossar) #1

When I view the source on a Discourse forum that is not being served by a CDN, the stylesheet link tag points to a /stylesheets/ directory. Where is that directory?


#2

look this :

globs = ["#{Rails.root}/app/assets/stylesheets/**/*.*css"]

(Simon Cossar) #3

I don’t think that’t it for the production stylesheets.


(Sam Saffron) #4

its in tmp directory and stylesheet_cache table


(Simon Cossar) #5

I’m asking because it’s not finding the _rtl stylesheet, but the RTL stylsheet is in tmp/stylesheet-cache/


(Sam Saffron) #6

what version are you running, had some bugs I fixed yesterday.

upgrade to latest and be sure that assets:precompile runs.


(Simon Cossar) #7

The latest version on the master branch. assets:precompile runs. The ltr and rtl versions of the stylesheets are all present in tmp/stylesheet-cache.

With a LTR language the stylesheet link tag is outputting this:
<link href="/stylesheets/desktop_0eb6bcb9ae52a6f7bcd2c532c6f8f020d1b7a01b.css?__ws=forum.bookswithwings.org" media="all" rel="stylesheet">

This is finding the stylesheet.

With a RTL language the stylsheet link is:
<link href="/stylesheets/desktop_rtl_0eb6bcb9ae52a6f7bcd2c532c6f8f020d1b7a01b.css?__ws=forum.bookswithwings.org" media="all" rel="stylesheet">

This is returning a status of 404. But the rtl file is present in tmp/stylesheet-cache

I also tried setting up a new installation of Discourse and got the same results.

When I apply the changes made in this PR to an older version of Discourse (when you were still accessing the stylesheets in the uploads/stylesheet-cache directory, everything works as expected.


(Sam Saffron) #8

confirmed, repro here, will get it sorted


(Sam Saffron) #9

I bet it’s the underscore based splitting in the controller


(Simon Cossar) #10

I tried removing the underscore before ‘rtl’ and it still couldn’t find the rtl stylesheets, but I might have missed something when I did it.


(Simon Cossar) #11

Yeah, this seems to fix the problem.

target,digest = params[:name].split("_")

target = params[:name].rpartition("_").first
digest = params[:name].rpartition("_").last

(Sam Saffron) #12

Pushed a fix

https://github.com/discourse/discourse/commit/bcaed90744bf470504b883010f28c9f59bd33505


(Sam Saffron) #13