Details

    • Similar Issues:
      Show 5 results 

      Description

      Portlets configured with render-weight=0 fail executing h.delegate.syncTargets(); in d.refresh() due to the fact that d.layoutHandler is undefined.

      var d = {
          ...
          
          refresh: function (i) {
              var h = d.layoutHandler;
              i = a.one(i);
              if (i) {
                  h.delegate.syncTargets();
                  Liferay.Layout.updatePortletDropZones(i)
              }
          },
          
          ...
      }
      

        Issue Links

          Activity

          Hide
          Oliver Färber added a comment -

          /html/js/liferay/layout.js

          var Layout = {
              ...
              refresh: function(portlet) {
                  var layoutHandler = Layout.layoutHandler;
          
                  portlet = A.one(portlet);
          
                  if (portlet) {
                      layoutHandler.delegate.syncTargets();
          
                      Liferay.Layout.updatePortletDropZones(portlet);
                  }
              }
              ...
          }
          
          Show
          Oliver Färber added a comment - /html/js/liferay/layout.js var Layout = { ... refresh: function(portlet) { var layoutHandler = Layout.layoutHandler; portlet = A.one(portlet); if (portlet) { layoutHandler.delegate.syncTargets(); Liferay.Layout.updatePortletDropZones(portlet); } } ... }
          Hide
          Oliver Färber added a comment -

          Quick Fix via Hook:

          refresh: function(portlet) {
              var layoutHandler = Layout.layoutHandler;
          
              portlet = A.one(portlet);
          
              if (portlet) {
                  
                  if(layoutHandler) {
                      layoutHandler.delegate.syncTargets();
                  }
          
                  Liferay.Layout.updatePortletDropZones(portlet);
              }
          }
          
          Show
          Oliver Färber added a comment - Quick Fix via Hook: refresh: function(portlet) { var layoutHandler = Layout.layoutHandler; portlet = A.one(portlet); if (portlet) { if (layoutHandler) { layoutHandler.delegate.syncTargets(); } Liferay.Layout.updatePortletDropZones(portlet); } }
          Hide
          Oliver Färber added a comment -

          It seems like there are a lot more JS errors related to the render-weight=0 setting, e.g. in the selector-css3 module...

          Show
          Oliver Färber added a comment - It seems like there are a lot more JS errors related to the render-weight=0 setting, e.g. in the selector-css3 module...
          Hide
          Alberto Chaparro added a comment - - edited

          When you set render weight to 0, the service.js file is not automatically loaded and if you need those services (for example, components like tags or categories selector use those services) the portlet will throw javascript exceptions.

          You can avoid this loading the javascript file through your liferay-portlet.xml file, for example for this case:
          <footer-portal-javascript>/html/js/liferay/service.js</footer-portal-javascript>

          Show
          Alberto Chaparro added a comment - - edited When you set render weight to 0, the service.js file is not automatically loaded and if you need those services (for example, components like tags or categories selector use those services) the portlet will throw javascript exceptions. You can avoid this loading the javascript file through your liferay-portlet.xml file, for example for this case: <footer-portal-javascript>/html/js/liferay/service.js</footer-portal-javascript>
          Hide
          Oliver Färber added a comment -

          This does not seem to work for us, service.js is already included... still getting "i/h is undefined" errors.

          Show
          Oliver Färber added a comment - This does not seem to work for us, service.js is already included... still getting "i/h is undefined" errors.
          Hide
          Tejas Kanani added a comment -

          Thank you for the report. As part of our community verifier program, I am going to verify it against Liferay 6.2 CE M4 version. If found fixed on current version then it will be treated as fixed and issue will be closed.

          Show
          Tejas Kanani added a comment - Thank you for the report. As part of our community verifier program, I am going to verify it against Liferay 6.2 CE M4 version. If found fixed on current version then it will be treated as fixed and issue will be closed.
          Hide
          Tejas Kanani added a comment -

          Verified it by following below steps.

          • Created simple plugins portlet using Liferay 6.2 CE M4 Plugins SDK (without specifying any render-weight value)
          • deployed and verified, working fine.
          • added <render-weight>0</render-weight> in liferay-portlet.xml
          • deployed and verified, found working fine and not getting any js error.

          So Its likely to be fixed in current Liferay 6.2 CE M4 version and I recommend it to be fixed.

          Show
          Tejas Kanani added a comment - Verified it by following below steps. Created simple plugins portlet using Liferay 6.2 CE M4 Plugins SDK (without specifying any render-weight value) deployed and verified, working fine. added <render-weight>0</render-weight> in liferay-portlet.xml deployed and verified, found working fine and not getting any js error. So Its likely to be fixed in current Liferay 6.2 CE M4 version and I recommend it to be fixed.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 26 weeks, 1 day ago

                Development

                  Subcomponents

                    Structure Helper Panel