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

If portal.proxy.path is set to utilize a reverse proxy, AlloyEditor fails to load editor toolbar

    Details

      Description

      Issue
      After setting up a reverse proxy, and setting Liferay to utilize portal.proxy.path context of /abc, AlloyEditor fails to load up the pop-up editor toolbar that allows a user to change the formatting, include links, and so on.

      The reason seems to be that Liferay does not recognize the context set in portal.proxy.path as we can see the following errors in the console that are related to AlloyEditor:

      ckeditor.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1491555836001:73 GET http://localhost/o/frontend-editor-alloyeditor-web/alloyeditor/lang/alloy-editor/en.js?t=GB1M 
      append	@	ckeditor.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1491555836001:73
      appendTo	@	ckeditor.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1491555836001:49
      q	@	ckeditor.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1491555836001:219
      load	@	ckeditor.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1491555836001:219
      loadLanguageResources	@	liferay-alloy-editor-no-ckeditor-min.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1...:3
      initializer	@	liferay-alloy-editor-no-ckeditor-min.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1...:399
      _callChain	@	liferay-alloy-editor-no-ckeditor-min.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1...:393
      init	@	liferay-alloy-editor-no-ckeditor-min.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1...:392
      r	@	liferay-alloy-editor-no-ckeditor-min.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1...:392
      r	@	liferay-alloy-editor-no-ckeditor-min.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1...:398
      editable	@	liferay-alloy-editor-no-ckeditor-min.js?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1...:1
      initializer	@	?browserId=other&minifierType=&languageId=en_US&b=7010&t=1491555836225&/abc/o/frontend-js-web/aui/e...:31
      _initHierarchy	@	?browserId=other&minifierType=&languageId=en_US&b=7010&t=1491555836225&/abc/o/frontend-js-web/aui/e...:2
      _baseInit	@	?browserId=other&minifierType=&languageId=en_US&b=7010&t=1491555836225&/abc/o/frontend-js-web/aui/e...:2
      init	@	?browserId=other&minifierType=&languageId=en_US&b=7010&t=1491555836225&/abc/o/frontend-js-web/aui/e...:3
      _initBase	@	?browserId=other&minifierType=&languageId=en_US&b=7010&t=1491555836225&/abc/o/frontend-js-web/aui/e...:2
      v	@	?browserId=other&minifierType=&languageId=en_US&b=7010&t=1491555836225&/abc/o/frontend-js-web/aui/e...:2
      q	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:759
      q	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:1010
      h	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:1105
      c	@	manage?p_p_id=com_liferay_journal_web_portlet_JournalPortlet&p_p_lifecycle=0&p_p_state=maximized&p_...:49
      initEditor	@	manage?p_p_id=com_liferay_journal_web_portlet_JournalPortlet&p_p_lifecycle=0&p_p_state=maximized&p_...:52
      (anonymous)	@	manage?p_p_id=com_liferay_journal_web_portlet_JournalPortlet&p_p_lifecycle=0&p_p_state=maximized&p_...:53
      (anonymous)	@	manage?p_p_id=com_liferay_journal_web_portlet_JournalPortlet&p_p_lifecycle=0&p_p_state=maximized&p_...:53
      function.q.(anonymous function)	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:669
      _notify	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:415
      (anonymous)	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:417
      _notify	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:415
      (anonymous)	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:417
      _notify	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:415
      ya	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:417
      _finish	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:507
      _onSuccess	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:508
      N	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:512
      _insert	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:513
      (anonymous)	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:514
      _continue	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:513
      insert	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:514
      _use	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:418
      ya	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:417
      _finish	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:507
      _onSuccess	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:508
      N	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:512
      onSuccess	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:513
      _finish	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:456
      _next	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:460
      _progress	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:461
      g	@	everything.jsp?browserId=other&themeId=admin_WAR_admintheme&colorSchemeId=01&minifierType=js&minifi...:458
      

      Steps to Reproduce
      1. Set up a reverse proxy server. In my test case, I have set up nginx on my macOS environment with the following conf file stored in /usr/local/etc/nginx/servers:
      abc.conf

      server {
              listen  80;
              server_name     localhost;
              proxy_set_header Host $http_host;
              location /abc/ {
                      proxy_set_header HOST $host;
                      proxy_set_header X-Forwarded-Proto $scheme;
                      proxy_set_header X-Real-IP $remote_addr;
                      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                      proxy_pass http://localhost:8080/;
              }
      }

      2. Restart nginx, and verify you can access it on http://localhost or http://localhost:80
      3. Set up a DXP + DE-13 environment
      4. Add the following line to portal-ext.properties:

      portal.proxy.path=/abc

      5. Start up Liferay
      6. Access Liferay through http://localhost/abc
      7. Sign in as test@liferay.com
      8. Go into Product Menu > Liferay DXP (Site) > Content > Web Content
      9. In your browser, open the inspector (chrome) or firebug (Firefox) and Create a new Basic Web Content
      10. Assert that there are several errors related to "http://localhost/o/frontend-editor-alloyeditor-web/alloyeditor/lang/alloy-editor/en.js?t=GB1M " – notice how the proxy path of /abc is not included
      11. Click on the Content field

      Actual Result
      Assert that the + icon to the left of the Content field does not appear, meaning I am unable to add formatting, add links, or images to AlloyEditor

      Expected Result
      The + icon to the left of the Content field appears.

      Note
      If we disable the portal.proxy.path property, and access Liferay via http://localhost:8080, the Content field displays the + icon allowing AlloyEditor's dynamic toolbar

        Attachments

        1. failed-on-ee70x.png
          failed-on-ee70x.png
          313 kB
        2. fixed-lps71785.png
          fixed-lps71785.png
          171 kB
        3. portal.proxy.path.missing.toolbar.png
          portal.proxy.path.missing.toolbar.png
          255 kB
        4. reproduce-lps71785.png
          reproduce-lps71785.png
          169 kB

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 18 weeks, 5 days ago

                Packages

                Version Package
                7.0.0 DXP FP16
                7.0.3 CE GA4
                7.0.0 DXP SP4
                7.0.X EE
                7.1.X
                Master