Moodle

css doesn't load since mime type is incorrect

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Cannot Reproduce
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Themes
  • Labels:
    None
  • Environment:
    apache 2 on ubuntu, php 5.2, firefox 2.004
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE

Description

I found themes not loading on my test installation, with in the error message in the firefox error console that the MIME type was text/html in stead of the expected text/css.

I added header ('Content-Type: text/css'); to theme/standard/styles.php which solved the issue

Activity

Hide
Urs Hunkler added a comment -

On my ubuntu server with apache 2 and php 5.1.6 the mimetype is correct. Might we have a PHP 5.2 issue here.

Show
Urs Hunkler added a comment - On my ubuntu server with apache 2 and php 5.1.6 the mimetype is correct. Might we have a PHP 5.2 issue here.
Hide
Bryce Thornton added a comment -

I was having the same problem with php 5.1.2 on a test server. After much debugging, I figured out that I had an extra carriage return at the bottom of my config.php file. So, to anybody else having this issue, make sure you pay attention to the config-dist.php directions:

// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
?>

Show
Bryce Thornton added a comment - I was having the same problem with php 5.1.2 on a test server. After much debugging, I figured out that I had an extra carriage return at the bottom of my config.php file. So, to anybody else having this issue, make sure you pay attention to the config-dist.php directions: // MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES, // RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE. ?>
Hide
Koen Roggemans added a comment -

Not the case for my config.php

Show
Koen Roggemans added a comment - Not the case for my config.php
Hide
Francois Marier added a comment - - edited

I just ran into this problem after upgrading from "1.9.2+ (Build: 20080828)" to "1.9.3 (Build: 20081016)"

(This is using Firefox 3.0.3 on Ubuntu Hardy, PHP 5.2.4-2ubuntu5.3 and Postgres 8.3.)

Setting the content-type to text/css in all theme/*/styles.php does make the problem go away.

Show
Francois Marier added a comment - - edited I just ran into this problem after upgrading from "1.9.2+ (Build: 20080828)" to "1.9.3 (Build: 20081016)" (This is using Firefox 3.0.3 on Ubuntu Hardy, PHP 5.2.4-2ubuntu5.3 and Postgres 8.3.) Setting the content-type to text/css in all theme/*/styles.php does make the problem go away.
Hide
Francois Marier added a comment -

Actually, in my case, the problem was caused by a stray blank line at the end of lib/weblib.php

I no longer have to set the content-type explicitly in the themes' styles.php.

Show
Francois Marier added a comment - Actually, in my case, the problem was caused by a stray blank line at the end of lib/weblib.php I no longer have to set the content-type explicitly in the themes' styles.php.
Hide
Tim Hunt added a comment -

I cannot reproduce this problem in Moodle 1.9.4.

Show
Tim Hunt added a comment - I cannot reproduce this problem in Moodle 1.9.4.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: