warning

Last modified by Lucas Charpentier on 2026/10/13 16:25

Audit

Macro ID
warning
Source
XS
Type
Wrapper
Classification reason

Status
Reviewed
Criteria version

XWiki version
18.8.0
Audit date
2026-10-13
Auditor
Compared macros
info box

Sources

Where to gather the information the criteria are checked against, see Gather the sources.

SourceWhat it givesUsed forWhere
DocumentationParameters, default values and examples, including the most common exampleL2, L3, and the criteria measured with the most common examplehttps://www.xwiki.org/xwiki/bin/view/documentation/xs/user/base/page/edit/warning-macro/
Source codeHow the macro declares its parameters and content: types, groups, features, advanced and hidden flags, constraints, content type, inline supportC4, C5, C7, C8, C9, C13, E4, E6https://github.com/xwiki/xwiki-rendering/blob/xwiki-rendering-18.8.0/xwiki-rendering-macros/xwiki-rendering-macro-message/src/main/java/org/xwiki/rendering/internal/macro/message/WarningMessageMacro.java
Macro descriptorWhat the Edit Macro dialog is built from, on design.xwiki.orgD1, D2, C1 to C9, E4Descriptor, list of macros with their categories
TranslationsThe name, description and parameter names in each languageD1, D2, D4, C1l10n.xwiki.org
Uses in XWiki pagesHow XWiki itself uses the macro, a realistic example when the documentation has noneL3, C2, C3, C6, C8, C9Search the xwiki organization on GitHub
Compared macrosThe audits of the macros of the same typeL1, D3info, box
Other sources specific to this macro
CriterionResultNotes
D1 wordingOK
D2 summaryKOthe description "Displays a warning message note." repeats the name, and does not say that the message is shown in a highlighted box with a warning icon.
D3 categoryOK
D4 quick-actionKOQuick Actions finds the macro for "warning", "warn" and the French name "Message d'avertissement", but under the name "Warning Box": the macro name "warning message" gives no result. The synonyms "note", "callout", "alert" and "caution" do not find it, "note" and "caution" list Footnote and Notifications. In the Insert Macro dialog, "note" finds it in 6th position.
L1 consistencyOKcompared with info and box. info behaves the same, it shares the same Java class. box differs by design: its content is optional, and its Quick Action inserts an empty box shown as "macro:box", while warning inserts a default text. Macros of the same type do not need the same features, so these differences are not a KO.
L2 doc-parametersOK
L3 doc-exampleOK
I1 patternOKwarning is the reference wrapper macro. From Quick Actions ("Warning Box") and from Insert > Warning Box, it is inserted directly with a default text. From Insert > Other Macros, the Edit Macro dialog opens with a required Content text area.
I2 zero-configOKQuick Actions inserts a default text, so there is no error box. In the Edit Macro dialog, Submit with an empty content does nothing and shows no message. A content emptied in the editor saves and renders as an empty box, but an empty content written in the source renders "The required content is missing."
I3 instantOK
I4 cursorKOminor: after insertion from Quick Actions, the cursor is at the start of the default text "Type your warning message here.", which is real content and is not selected: typing adds to it, and the user has to delete it. Saving without editing keeps the default text in the page.
I5 focusN/A
E1 wysiwygOK
E2 errorsKOinvalid values are accepted silently, with no message. For example, {{warning width="abc"}}This is a warning message{{/warning}} renders with style="width:abc" and no error; {{warning image="missing.png"}}This is a warning message{{/warning}} renders a broken image, with no attachment missing.png on the page; {{warning status="maybe"}}This is a warning message{{/warning}} is read as false. Only an empty content gives an error.
E3 nestingKOthe warning renders in a list item, a table cell and a box, and a list, a table and a box render and can be edited inside its content. But in a list item and in a table cell the warning is inline, and its content cannot be edited in place: the content span is not editable and typed text is lost.
E4 inline-supportOKthe macro declares inline support, and renders as a span inside a sentence.
E5 emptyOK
E6 inplaceKOthe content of a standalone warning is edited in place, but the Edit Macro dialog still shows it as a wiki syntax text area, also when editing an existing warning. The content of an inline warning, in a sentence, a list item or a table cell, can only be edited through that text area.

Parameters

ParameterC1 clarityC2 mandatoryC3 defaultsC4 input-assistanceC5 groupsC6 orderC7 alternativesC8 advancedC9 technicalC13 constraintsNotes
$contentOKOKN/AOKN/AOKN/AN/AN/AN/A

C4: edited in place for a standalone warning; the wiki syntax text area of the dialog is recorded under E6.

cssClassKOOKOKOKOKOKN/AOKOKN/A

C1: shown as "CssClass" with the description "A CSS class to add to the box element", technical terms. The message macros have no translation keys for the parameters inherited from box, so the dialog shows the parameter ID in every language; the box keys themselves name it "cssClass" in English.

C9: no documentation example uses it. A realistic use is styling one message on an application page, which targets developers: it could rather be advanced.

imageOKOKOKKOOKOKN/AOKOKN/A

C4: a free text field, with no image picker; a reference to a missing attachment is accepted. XWIKI-22863 proposes to deprecate the image of the box macro.

statusOKOKOKOKOKOKN/AOKOKN/A
titleOKOKOKOKOKOKN/AOKOKN/A

C6: the parameters are in alphabetical order, cssClass, image, title, width, status. The most common example sets none of them, so the order is OK per the measure, but title is the one users are most likely to set.

widthOKOKOKOKOKOKN/AOKOKKO

C13: only accepts a CSS length "in px or %", but declares no format: "abc" is accepted by the dialog and output as style="width:abc".

KOs and tickets

Every KO needs a ticket covering it, see Report the KOs. One ticket can cover several KOs. Known issues filed for this macro are suggested in italics: link them as existing tickets when they cover the KO.

KOCriterionExisting ticketsNew tickets
D2D2 summary
D4D4 quick-action
I4I4 cursor
E2E2 errors
E3E3 nestingKnown: XWIKI-23623
E6E6 inplace
C1:cssClassC1 clarity, cssClass
C4:imageC4 input-assistance, image
C13:widthC13 constraints, width
Warning

9 of the 9 KOs are not covered by a ticket yet.

Tickets

TicketOriginKOs covered
NewD2

Known issues of this macro

IssueTitleStatusCriteria
XWIKI-22028CKEditor / Xwiki 2.1 Syntax: Multi-paragraph Highlighting BoxesOpen
XWIKI-23623Table cell actions not available in WYSIWYG when inside macro with in-line editable contentOpenE3

69 more known issues affect every macro: see the Known issues.

Get Connected