Uploaded image for project: 'Nuxeo Elements'
  1. Nuxeo Elements
  2. ELEMENTS-646

Use console instead of log in nuxeo-user-avatar element

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.7, 2.3.2
    • Component/s: UI

      Description

      The element nuxeo-user-tag is used to display a user avatar with this code:

       <nuxeo-user-tag fetch-avatar user="[[value]]"></nuxeo-user-tag>
      

      If the user is not found, this error is displayed in the browse console

      elements.html:46984 Uncaught (in promise) ReferenceError: log is not defined
          at HTMLElement.<anonymous> (elements.html:46984)
          at <anonymous>
      (anonymous) @ elements.html:46984
      ...
      elements.html:24097 
      

      because of this code:

      log.warn("Cannot fetch profile for user " + this._username(this.user));
      

      The proper way to log a message in JavaScript is to use Console, not log

      The route cause is getting an unknown user returns a 404, but it may not be possible to fix that

      GET http://localhost:8080/nuxeo/api/v1/user/system 404 ()
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 10 minutes
                10m