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

When making Asset Publisher AJAXable, and having empty content return, the portlet breaks

    Details

      Description

      Description
      When making Asset Publisher AJAXable, and having empty content return, the portlet breaks

      Steps to reproduce/Testing done

      1. On 6.1 and 6.2:
        1. Edit the WEB-INF/liferay-portlet.xml so that portlet 101 (Asset Publisher) has a render-weight of zero.
      2. On master:
        1. modify PortletImpl.java; line: 275. Modify the _renderWeight = renderWeight line to be
          		if (portletId.contains("AssetP")) {
          			_renderWeight = 0;
          		}
          		else {
          			_renderWeight = renderWeight;
          		}

          (I tried to modify the renderWeight in AssetPublisherPortlet.java, to be 0. But it was automatically set to be 1. Defeating this test. )

      1. Start Liferay and Login as admin
      2. Add an Asset Publisher portlet to the page
      3. Add web content via the Asset Publisher
      4. Go to Asset Publisher > Configuration and check Enable Permissions
      5. Go to Control Panel > Users and Organizations
      6. Add a new user with only the power user role
      7. Log on to the new user and verify the Asset Publisher portlet is displaying the web content
      8. Edit the web content permissions so that only the Owner can view it
      9. Back on the new user, look at the page with the Asset Publisher and notice that an error is displayed, or the "portlet Loading displays indefinitely"
      10. Also note the browser console error: "Uncaught TypeError: Cannot read property 'attr' of null"

      Results of Testing
      Expected behavior: The Asset Publisher is not visible if it has no content to display to the current user, and it is set as ajaxable
      Actual behavior: The Asset Publisher throws an error on the page if it has no content to display to the current user, and it is set as ajaxable

      Errors/Logs
      Browser console: Uncaught TypeError: Cannot read property 'attr' of null

      Reproduced...
      Reproduced in trunk? Yes. c379b6b7f95d63080698c6fba46ba96d0c9e0959
      Reproduced in 6.1.x? Yes. (622d8bcc652f677b2913e2a9be3c033f4464c55e)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              melody.wu Melody Wu
              Reporter:
              steven.smith Steven Smith (Inactive)
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 44 weeks, 4 days ago

                  Packages

                  Version Package
                  6.1.X EE
                  6.2.X EE
                  7.0.0 Beta 1