Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-40482

Can't configure portlets in Welcome theme under some circumstances (missing images)

    Details

      Description

      There are several 404 errors in welcome-theme when logged in:

      http://localhost:8080/welcome-theme/html/themes/classic/images/portlet/options_borderless.png
      http://localhost:8080/welcome-theme/html/themes/classic/images/common/edit_white.png
      http://localhost:8080/welcome-theme/html/themes/classic/images/common/add_white.png
      http://localhost:8080/welcome-theme/html/themes/classic/images/common/configuration_white.png
      http://localhost:8080/welcome-theme/html/themes/classic/images/portlet/close_borderless.png
      http://localhost:8080/welcome-theme/html/themes/classic/images/portlet/draggable_borderless.png
      http://localhost:8080/welcome-theme/html/themes/classic/images/arrows/12_left.png
      http://localhost:8080/welcome-theme/html/themes/classic/images/portlet/header_bg.png
      

      This causes some lack of features, such as configure some portlets, etc.


      LPS-34124 makes the assumption that we want the .sass-cache contents from the parent theme. But the problem is, those files are generated against the parent theme, which could have a different base path. If the child theme has no modified files, the .sass-cache never gets regenerated and has the wrong paths.

      Incorrect (added: html/themes/classic/):

      css\.sass-cache\custom.css
      background-image: url(../images/portlet/options_borderless.png);
      
      css\.sass-cache\main.css
      background-image: url(@base_url@/html/themes/classic/css/../images/portlet/options_borderless.png
      
      css\custom.css
      background-image: url(../images/portlet/options_borderless.png);
      

      Correct:

      css\.sass-cache\custom.css
      background-image: url(../images/portlet/options_borderless.png);
      
      css\.sass-cache\main.css
      background-image: url(@base_url@/css/../images/portlet/options_borderless.png)
      
      css\custom.css
      background-image: url(../images/portlet/options_borderless.png);
      

      The proper test would be to build a bundle. Below are alternative tests to see the fix in a superficial way.

      Theme build test:

      1. In the theme's folder themes/welcome-theme run $ ant clean war
      2. Inspect the files, mentioned above, and ensure the urls look correct.

      "Hacky" test using existing bundle:

      1. Download tomcat bundle liferay-portal-6.2.0-ce-rc1
      2. Launch Portal
      3. Open Portal, and finish initial setup. Ensure you are logged in.
      4. Open the browser's console. F12
      5. Refresh the homepage
      6. See 404 warnings (bug)
      7. WAR the Welcome Theme themes/welcome-theme $ ant clean war
      8. Copy plugins/themes/welcome-theme/docroot/css to bundle/tomcat/webapps/welcome-theme/css, replacing all files.
      9. Kill tomcat
      10. Delete tomcat/work
      11. Launch Portal
      12. Reload the homepage. Ensure you are logged in.
      13. See no 404 warnings (fixed)

      Test in Portal:

      The test below cannot replicate the bug in master.
      It seems like the .sass-cache files are not read, and instead, built correctly from the non .sass-cache files and read from tomcat/work.

      1. Launch Portal
      2. Open Portal, and finish initial setup. Ensure you are logged in.
      3. Deploy Resources Importer web/resources-importer-web ant deploy
      4. Deploy Welcome Theme themes/welcome-theme $ ant clean deploy
      5. Open the browser's console. F12
      6. Refresh the homepage

      Expected Results:
      No 404 warnings should be displayed.

      Actual Results:
      404 warnings displayed.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 8 weeks, 2 days ago

                  Packages

                  Version Package
                  6.2.0 CE RC2