-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
Major
-
Issue Summary
Static content macros defined with an attachment parameter allowing multiple attachments can not be saved. A minimal app has been produced to reproducing this: https://glitch.com/edit/#!/dx-static-macro-with-attach-param. It's connect descriptor is as follows:
{ "key": "dx-static-macro-with-attach-param", "version": "a", "name": "DX Static Macro with Attachment Parameter App", "baseUrl": "https://dx-static-macro-with-attach-param.glitch.me/", "authentication": { "type": "none" }, "enableLicensing": false, "scopes": [], "modules": { "staticContentMacros": [{ "key": "dx-static-macro-with-attach-param", "name": { "value": "DX Static Macro with Attachment Parameter" }, "description": { "value": "A static content macro with a multiple attachment parameter" }, "renderingMethod": "get", "width": "500px", "height": "500px", "url": "/macro-view.html?pageTitle={page.title}", "bodyType": "none", "outputType": "block", "parameters": [{ "identifier": "the-attach", "name": { "value": "The attachments" }, "type": "attachment", "multiple": true, "hidden": false, "indexing": { "enabled": false } }] }] } }
Steps to Reproduce
- Install the minimal app using descriptor URL https://dx-static-macro-with-attach-param.glitch.me/connect.json.
- Create/edit a page.
- Add an attachment to the page.
- Insert the app's "DX Static Macro with Attachment Parameter" macro into the page.
- Open the browser's dev tools and observe the console messages.
- Open the macro editor and select the attachment added to the page.
- Observe the console messages again.
- Close the macro editor.
- Open the macro editor.
- Observe if the previously selected attachment is still selected.
Expected Results
At step 7, no new error messages are visible.
At step 10, the previously selected attachment(s) are still selected.
Actual Results
At step 7, the following error messages are visible:
react_devtools_backend.js:2842 Error getting placeholder ADF overrideMethod @ react_devtools_backend.js:2842 u @ fetchMacroAttributes.ts:70 async function (async) u @ fetchMacroAttributes.ts:56 Ce @ manifest-helpers.ts:87 l @ extension-provider.ts:314 vh @ context-panel.js:130 async function (async) vh @ context-panel.js:124 onChange @ context-panel.js:73 (anonymous) @ ConfigPanel.js:152 async function (async) (anonymous) @ ConfigPanel.js:151 (anonymous) @ ConfigPanel.js:113 componentDidUpdate @ ConfigPanel.js:293 cs @ react-dom.production.min.js:212 wu @ react-dom.production.min.js:255 t.unstable_runWithPriority @ scheduler.production.min.js:19 $o @ react-dom.production.min.js:122 _u @ react-dom.production.min.js:248 su @ react-dom.production.min.js:239 (anonymous) @ react-dom.production.min.js:123 t.unstable_runWithPriority @ scheduler.production.min.js:19 $o @ react-dom.production.min.js:122 Ko @ react-dom.production.min.js:123 Zo @ react-dom.production.min.js:122 ru @ react-dom.production.min.js:230 enqueueSetState @ react-dom.production.min.js:132 _.setState @ react.production.min.js:12 (anonymous) @ index.js:75 setTimeout (async) (anonymous) @ index.js:71 (anonymous) @ index.js:72 (anonymous) @ index.js:48 (anonymous) @ index.js:30 emit @ index.js:30 (anonymous) @ index.js:50 apply @ index.js:33 M.e.state.apply @ instrumented-plugin.js:21 b.applyInner @ index.es.js:867 b.applyTransaction @ index.es.js:831 (anonymous) @ ReactEditorView.js:265 dispatchTransaction @ ReactEditorView.js:337 zt.dispatch @ index.es.js:4890 (anonymous) @ plugin-state-factory.js:92 (anonymous) @ context-panel.js:87 onCancel @ context-panel.js:86 (anonymous) @ usePlatformLeafEventHandler.js:55 s @ react-dom.production.min.js:14 h @ react-dom.production.min.js:14 (anonymous) @ react-dom.production.min.js:14 m @ react-dom.production.min.js:15 st @ react-dom.production.min.js:52 it @ react-dom.production.min.js:51 ut @ react-dom.production.min.js:52 dt @ react-dom.production.min.js:56 D @ react-dom.production.min.js:287 z @ react-dom.production.min.js:19 Jt @ react-dom.production.min.js:70 Xt @ react-dom.production.min.js:69 t.unstable_runWithPriority @ scheduler.production.min.js:19 $o @ react-dom.production.min.js:122 N @ react-dom.production.min.js:287 Zt @ react-dom.production.min.js:68 Show 30 more frames transformers.ts:79 Uncaught (in promise) TypeError: Cannot read property 'parameters' of undefined at m (transformers.ts:79) at u (fetchMacroAttributes.ts:84) at async l (extension-provider.ts:314) at async vh (context-panel.js:130) at async onChange (context-panel.js:72)
At step 10, the previously selected attachment(s) are not selected.
Workaround
None