Uploaded image for project: 'PUBLIC - Liferay Alloy UI'
  1. PUBLIC - Liferay Alloy UI
  2. AUI-3193

'Uncaught Anim' in browser console

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.0-deprecated.76
    • Fix Version/s: None
    • Component/s: Carousel
    • Environment:

      Description

      Hello,
      I noticed there is an repeating error in browser console.

      It is thrown from AUI carousel component when comment is added (<liferay:comment:discussion/>).
      It is a little bit complicated to reproduce this issue (2 components located within some entry), so i have created a sample module. See attachment called entry-test.rar. It is a maven module which you can deploy to Liferay environment according to following steps:

       

      1) Extract .rar file and copy it to to your workspace ./modules
      2) Correct the name of the parent groupId/artifactId in the main pom.xml (to fit it with dependencies between modules).
      3) Build and Deploy module.
      4) For adding a test entry insert the following record to ns_entrytest database table:
      INSERT INTO ns_entrytest VALUES ('abcd1234', 1, 0, 0, 39801, 'Test user', '2020-08-03 08:54:14.917', '2020-08-03 08:54:14.917', 'Test Title', 'Test Content');
      (39801 is the userId - choose some user who is omniAdmin due to permissions - ADD_COMMENT)
      5) Add portlet to some page.

      6) Open browser console.
      7) Add some comment.
      8) After comment is added and page is reloaded - see the error 'Uncaught Anim' in browser console.

      Details about error
      **Error is repeating accordingly to the value intervalTime: 5 (Carousel component).

      After a more deep investigation i noticed there is a suspicious function setInterval:

      Around this function 'setInterval (async)' is error repeated in browser console:

      So maybe this is a problem. Function is registered for some object/context and after reload is this context lost.

      I have tried to workaround this and successful story (without error in console) was to create comment-taglib JSP override where I made a following changes:

      This row:
      https://github.com/liferay/liferay-portal/blob/7.3.3-ga4/modules/apps/comment/comment-taglib/src/main/resources/META-INF/resources/discussion/page.jsp#L340
      I changed to:
      <%= namespace %>sendMessage(form, true);
       
      True value has been sent to refreshPage parameter here:
      https://github.com/liferay/liferay-portal/blob/7.3.3-ga4/modules/apps/comment/comment-taglib/src/main/resources/META-INF/resources/discussion/page.jsp#L670
       
      And then was called:

      window.location.reload();
      instead of:

      Liferay.Portlet.refresh(...)
       
      And error disapears.
       
       
      I hope these observations will be beneficial for you.
       
      Vaclav
       

        Attachments

          Activity

            People

            Assignee:
            ui_alloy UI Alloy
            Reporter:
            suchanek.vaclav999 Václav Suchánek
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              1 year, 16 weeks, 3 days ago

                Packages

                Version Package