The macro insertion dialog does not disable Submit on purpose: `macroEditor.js` validates on submit, aborting the insertion and flagging the first empty mandatory parameter.
`OfficeMacroParameters` declares no mandatory parameter: neither `setReference` nor the deprecated `setAttachment` carries `@PropertyMandatory` / `@PropertyFeature(mandatory = true)`.
So the parameter is not flagged as mandatory in the descriptor, validation passes, the macro is inserted without a `reference`, and the failure only shows at render time as the error in `OfficeMacro.getResourceReference` (the stack trace in the second comment).
The bug is the missing mandatory declaration, not the enabled Submit button. ___
`reference` and the deprecated `attachment` are two ways to give the same information, so a plain `@PropertyMandatory` would break existing `office attachment="f.doc"/` content. The "exactly one of these" mechanism already exists – the Include macro uses it for `reference` / `page`.
Proposal: put `@PropertyFeature(value = "reference", mandatory = true)` on *both* office setters.
UI: one feature group; `attachment` is deprecated and unset, so it is hidden and no radio buttons appear – just the reference field labelled "(required)", blocking an empty submit.
Server side: `DefaultBeanManager.checkFeatureMandatory` throws when neither parameter is set, so wiki syntax and quick actions get a proper parameter error too; existing content still validates.
Details: `checkFeatureMandatory` only checks presence, so `attachment=""` still passes and the runtime check in `OfficeMacro` must stay; the feature name needs a translation.
Out of scope: greying out Submit until required fields are filled is a generic `macroEditor.js` change affecting every macro, i.e. the design page linked above.
Tests: `xwiki-platform-office-macro` has no `src/test` yet, so either a new unit test on the macro descriptor there or an assertion in the WYSIWYG macro-editor Docker IT.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.