Details

      Description

      When theme css files are accessed they get aggregated into a single main.css file, but the relative paths are not transformed so the main.css will not be able to point to the right resource if the custom css is not in the same directory level as main.css.

      The attached test theme contains a test.css file in /<theme-root>/css/subdir/subdir2 which references an image using relative path:

      .logo {
      	background-image: url('../images/test-image.jpg');
      }
      

      Reproduction steps:
      1. Start a fresh portal with these properties

      com.liferay.portal.servlet.filters.strip.StripFilter=false
      javascript.fast.load=false
      minifier.enabled=false
      minifier.inline.content.cache.size=0
      com.liferay.portal.servlet.filters.cache.CacheFilter=false
      theme.css.fast.load=false
      

      2. Deploy the attached war (i.e. test-theme-6.1.30.1-without-cache.war)
      3. Change to the test theme (Manage -> Site Pages)
      4. Verify that the images have valid paths e.g. using firebug -> css tab -> search t1.jpg, t2.jpg etc.
      5. Restart server with the above properties commented out
      6. Verify that images have bad paths

      Another way to reproduce the same type of issue:

      1. Start Liferay using non-root context-path (set portal.ctx=/unique in the portal-ext.properties)
        • Rename tomcat-7.0.42\webapps\ROOT to tomcat-7.0.42\webapps\unique
        • Rename tomcat-7.0.42\conf\Catalina\localhost\ROOT.xml to tomcat-7.0.42\conf\Catalina\localhost\unique.xml
        • In ROOT.xml (now unique.xml) change:
          <Context path="" crossContext="true">

          to

          <Context path="/unique" crossContext="true">
      2. Start the portal instance
        Navigate to http://localhost:8080/unique and login
      3. Go to Control Panel -> Dynamic Data Lists
      4. Create a new dynamic data list
      5. Go to the "View all"-tab of the dynamic data lists and click "Actions" -> "Spreadsheet View" on the created data list
      6. Press F12 in your browser and check the network tab.
        There will be a 404 GET-Request to the following URL: "http://localhost:8080/assets/skins/sam/sprite.png".

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 40 weeks, 6 days ago