Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-16669

CSS files don't get served correctly in presence of ezjscore's packer and eZDFS

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 4.4.0alpha2
    • 4.3.0
    • None
    • Operating System: CentOS 5.4
      PHP Version: 5.3.2
      Database and version: MySQL 5.1.x
      Cluster File System: eZ DFS
      Browser (and version): Safari 4.0.5

    Description

      If you set up a stock 4.3 installation with eZ Flow in clustering with eZ DFS, you'll see that CSS files do not get served, and return a 404 error.

      To get them served there's a missing rewrite rule you should add to the documentation for eZ DFS, which has been stated in the teamroom installation page though:

      RewriteRule ^/var/([^/]+/)?cache/public/(stylesheets|javascript).* /index_cluster.php [L]
      

      That rule goes up top, together with the other rules related to index_cluster.php.

      In addition to this, ezjscore doesn't set any datatype for css files, which then get served as 'misc'. Firefox is able to overcome this problem and just serves them correctly, but Chrome and Safari will just download the file on the desktop, thus preventing it from rendering correctly.

      Here's the result from the query:

      mysql> select * from ezdfsfile where name like 'var/ezflow_site/cache/public/stylesheets/20ffd5f9c8f19244360d3ac9e67ae601_all.css';
      +-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+----------------------------------+----------+---------------+--------+------------+---------+--------+
      | name                                                                              | name_trunk                                                                        | name_hash                        | datatype | scope         | size   | mtime      | expired | status |
      +-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+----------------------------------+----------+---------------+--------+------------+---------+--------+
      | var/ezflow_site/cache/public/stylesheets/20ffd5f9c8f19244360d3ac9e67ae601_all.css | var/ezflow_site/cache/public/stylesheets/20ffd5f9c8f19244360d3ac9e67ae601_all.css | 1236916bc6800445ea6bb73c3e500ef8 | misc     | UNKNOWN_SCOPE | 103863 | 1271338992 |       0 |      0 |
      +-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+----------------------------------+----------+---------------+--------+------------+---------+--------+
      1 row in set (0.00 sec)
      

      A quick workaround is to execute the following statements, although at the next cache clearing, the problem will represent itself:

      -- This is for ezdb, but the same queries will work with eZDB using ezdbfile instead
      UPDATE ezdfsfile SET datatype = 'text/css' WHERE name LIKE '%/cache/public/stylesheets/%';
      UPDATE ezdfsfile SET datatype = 'text/javascript' WHERE name LIKE '%/cache/public/javascript/%';
      

      The only other solution (suggested) is to disable the ezjscore packer by modifying /extension/ezjscore/settings/ezjscore.ini and uncommenting the following line until the issue will be fixed:

      #Packer=disabled
      

      Many thanks to Bertrand Dunogier who helped me out in figuring out the root of the issue.
      Max

      Steps to reproduce

      1. Install a stock installation of eZ Publish + eZ Flow
      2. Follow the guide to set up eZ DFS
      3. See that the stylesheets are not getting served properly
      4. Find the random teamroom page containing the missing rewrite rule
      5. See that the stylesheets get downloaded instead of displayed

      Attachments

        Activity

          People

            bd bd
            41302bda-6fe4-4c68-b526-aaafa5485935@accounts.ibexa.co Massimo Sanna
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: