AP.context.getContext() in Javascript API missing "confluence" context in legacy editor edit mode.

XMLWordPrintable

    • Minor
    • 1

      Issue Summary

      If we add a dynamic content macro with editor in a Legacy page then from the editor call AP.context.getContext() , it doesn't return confluence context.

      Normally AP.context.getContext() will contain the following.

      // calling like this
      AP.context.getContext((response) => console.log(response)) 
      // we get response value like this
      {
        confluence: {...},
        url: {...}
      }
      

      But, if we do the same from a legacy page we only get url - confluence context is missing.

      // calling like this
      AP.context.getContext((response) => console.log(response)) 
      // we get response value like this and 'confluence' property is missing
      {
        url: {...}
      }
      

      Steps to Reproduce

      • create a connect app with dynamicContentMacro with Editor
         "dynamicContentMacros": [
              {
                "url": "/pages/macro",
                "name": {
                  "value": "Test Macro"
                },
                "key": "macro-key",
                "editor": {
                  "url": "/pages/macro/editor"
                }
              }
            ],
        
      • install the app in a test site with Legacy Editor enabled
      • Create a legacy page and add the macro
      • in the macro iframe call AP.context.getContext() and inspect the response
        AP.context.getContext((response) => console.log(response)) 
        

      Expected Results

      The response should contain "confluence" context

      Actual Results

      The response doesn't contain "confluence" context

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            Assignee:
            Unassigned
            Reporter:
            Nashid Farhad
            Votes:
            7 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: