Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25835

The Quick Action of a macro without mandatory fields inserts it without content, unlike the Insert Macro dialog

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 15.5-rc-1
    • CKEditor
    • None
    • Unknown

    Description

      Steps to reproduce

      1. Edit a page with the WYSIWYG editor.
      2. Type /box and pick Box in the Quick Actions.
      3. Save, and look at the page source.

      Expected result

      {{box}}{{/box}}, as when the box macro is inserted from the Insert Macro dialog with an empty content: the box is rendered empty and the user can type in it.

      Actual result

      {{box/}}: the macro is inserted with no content at all. The box macro renders nothing for a missing content, so the user gets no box to type in, and the same macro is saved differently depending on how it was inserted.

      This applies to every macro that supports a content and has no mandatory field, inserted from the generic macro Quick Actions. The xwiki-macro-maybe-install-insert command of plugin.js inserts the macro without a content, while the Insert Macro dialog includes an empty content on purpose, see macroEditor.js: "we want to generate {{macro}}{{/macro}} instead of {{macro/}} when the macro supports content".

      The fix would be to insert the macro with an empty content when its descriptor declares one.

      Found while discussing XRENDERING-827 on the forum.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Lucas C Charpentier Lucas
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: