Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-62983

Autoconvert for Widget Connector Macro cause issue on saving page when the URL contains Emoji

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 7.7.4, 7.10.1
    • Editor - Core
    • None

      Issue Summary

      Autoconvert for Widget Connector Macro cause issue on saving page when the URL contains Emoji

      Steps to Reproduce

      1. Edit a page and paste a URL that includes Emoji where it can be autoconvert into Widget Connector Macro (eg: Figma URL)
        Example URL that includes a Heart URL
        https://www.figma.com/file/eXZnisPZXgymtW2N8mqNbU/%E2%AD%90%EF%B8%8F?node-id=0%3A1
        
      2. Confirm that the pasted URL is autoconverted into a Widget Connector Macro
      3. Save/Publish the page

      Expected Results

      The page can be saved/published normally

      Actual Results

      Saving/Publishing the page throws an pop-up error on the editor screen with the message below:

      There was an error processing the request.
      

      The error below can be found in the console tab of the browser's developer tool:

      XHRPUThttp://localhost:27101/c7101/rest/api/content/65609?status=draft
      [HTTP/1.1 400  21ms]
      
      Generic error: {"readyState":4,"responseText":"{\"statusCode\":400,\"data\":{\"authorized\":true,\"valid\":false,\"allowedInReadOnlyMode\":true,\"errors\":[{\"message\":{\"key\":\"xhtml.editor.to.storage.generic.error\",\"args\":[]}}],\"successful\":false},\"message\":\"Validation failure when converting format\",\"reason\":\"Bad Request\"}","responseJSON":{"statusCode":400,"data":{"authorized":true,"valid":false,"allowedInReadOnlyMode":true,"errors":[{"message":{"key":"xhtml.editor.to.storage.generic.error","args":[]}}],"successful":false},"message":"Validation failure when converting format","reason":"Bad Request"},"status":400,"statusText":"error"} batch.js:2201:358
      

      The error message below will be recorded in the atlassian-confluence.log

      atlassian-confluence.log
      2021-04-02 15:47:26,149 ERROR [http-nio-27101-exec-3] [xhtml.editor.macro.MacroParameterTypeParserImpl] resolveUrl URL 'https://www.figma.com/file/eXZnisPZXgymtW2N8mqNbU/⭐️?node-id=0%3A1' was not valid, even after reencoding
       -- referer: http://localhost:27101/c7101/pages/editpage.action?pageId=65609 | url: /c7101/rest/api/content/65609 | traceId: be85c79ca4a815b6 | userName: admin
      2021-04-02 15:47:26,150 WARN [http-nio-27101-exec-3] [content.render.xhtml.DefaultFormatConverter] validateAndConvertToStorageFormat XhtmlException converting editor format to storage format. Turn on debug level logging to see editor format data.
       -- referer: http://localhost:27101/c7101/pages/editpage.action?pageId=65609 | url: /c7101/rest/api/content/65609 | traceId: be85c79ca4a815b6 | userName: admin
      com.atlassian.confluence.content.render.xhtml.XhtmlException: RuntimeException occurred while transforming editor format to storage format (com.atlassian.confluence.content.render.xhtml.XhtmlException: com.atlassian.confluence.content.render.xhtml.editor.macro.InvalidMacroParameterException: Invalid parameter value for macro 'widget' parameter 'url' (type url): 'https://www.figma.com/file/eXZnisPZXgymtW2N8mqNbU/⭐️?node-id=0%3A1')
      	at com.atlassian.confluence.content.render.xhtml.editor.EditorXhtmlTransformer.transform(EditorXhtmlTransformer.java:58)
      	at com.atlassian.confluence.content.render.xhtml.TransformerChain.transform(TransformerChain.java:33)
      	at com.atlassian.confluence.content.render.xhtml.TransformerChain.transform(TransformerChain.java:33)
      ...
      Caused by: java.lang.RuntimeException: com.atlassian.confluence.content.render.xhtml.XhtmlException: com.atlassian.confluence.content.render.xhtml.editor.macro.InvalidMacroParameterException: Invalid parameter value for macro 'widget' parameter 'url' (type url): 'https://www.figma.com/file/eXZnisPZXgymtW2N8mqNbU/⭐️?node-id=0%3A1'
      ...
      Caused by: com.atlassian.confluence.content.render.xhtml.XhtmlException: com.atlassian.confluence.content.render.xhtml.editor.macro.InvalidMacroParameterException: Invalid parameter value for macro 'widget' parameter 'url' (type url): 'https://www.figma.com/file/eXZnisPZXgymtW2N8mqNbU/⭐️?node-id=0%3A1'
      ...
      Caused by: com.atlassian.confluence.content.render.xhtml.editor.macro.InvalidMacroParameterException: Invalid parameter value for macro 'widget' parameter 'url' (type url): 'https://www.figma.com/file/eXZnisPZXgymtW2N8mqNbU/⭐️?node-id=0%3A1'
      ...
      Caused by: java.net.MalformedURLException: https://www.figma.com/file/eXZnisPZXgymtW2N8mqNbU/⭐️?node-id=0%3A1
      	at com.atlassian.confluence.content.render.xhtml.editor.macro.MacroParameterTypeParserImpl.resolveUrl(MacroParameterTypeParserImpl.java:247)
      	at com.atlassian.confluence.content.render.xhtml.editor.macro.MacroParameterTypeParserImpl.parseSingleMacroParameter(MacroParameterTypeParserImpl.java:174)
      	at com.atlassian.confluence.content.render.xhtml.editor.macro.MacroParameterTypeParserImpl.parseMacroParameter(MacroParameterTypeParserImpl.java:105)
      	... 382 more
      

      Note

      • The issue can be replicated when Collaborative Editing is turn ON or OFF
      • Not all emojis are affected. For example, link with the red heart %E2%9D%A4%EF%B8%8F throws error, but padlock %F0%9F%94%93 works.

      Workaround

      Insert the Widget Connector Macro manually, edit the macro and paste the URL into the "Web Site's Widget URL" field manually.

        1. pop-up warning.png
          pop-up warning.png
          24 kB
        2. widget connector macro.png
          widget connector macro.png
          69 kB
        3. workaround.png
          workaround.png
          112 kB

              Unassigned Unassigned
              btan@atlassian.com Damien Tan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: