attachmentGalleryPicker
Audit
- Macro ID
- attachmentGalleryPicker
- Source
- XS
- Type
- Generator
- Classification reason
- Status
- Reviewed
- Criteria version
- 15.20
- XWiki version
- 18.8.0
- Audit date
- 2026-10-16
- Auditor
- Compared macros
- attachmentSelector documentTree
Sources
Where to gather the information the criteria are checked against, see Gather the sources.
| Other sources specific to this macro |
|---|
|
| Criterion | Result | Notes |
|---|---|---|
| D1 wording | KO | minor: "Attachment Picker" uses plain words, but the macro is a developer building block: inserted in a page on its own, it shows a search field and a grid of attachments, and picking one only sends a JavaScript event, it inserts or links nothing. A user who types "attachment" to add an attachment to the page gets it second in Quick Actions, after Attachment Selector, another developer widget: no entry that adds an attachment comes before them, for "attachment" or "attach"; only "upload" gives the Image entry first. |
| D2 summary | KO | "Grid based attachment picker." repeats the name and does not say what the macro adds to the page: a search field with Current Page and All Pages scopes and a grid of attachments to pick from, meant to be wired to an application by JavaScript. To reproduce: open the Insert Macro dialog and select Attachment Picker. |
| D3 category | OK | the macro is in the Development category, like attachmentSelector, the other attachment widget for applications, which fits a macro whose selection is only usable from a script. documentTree is in Navigation, which does not apply here. |
| D4 quick-action | KO | Quick Actions finds the macro first for "attachmentGalleryPicker", "Attachment Picker" and the French name "Sélecteur de pièces jointes", and second for the synonym "attachment", after Attachment Selector. The synonyms "file", "file picker", "image picker" and "select attachment" give no result. |
| L1 consistency | OK | compared with attachmentSelector and documentTree. Like documentTree, no parameter is mandatory, there is no content, and the Quick Action inserts the macro right away, with no dialog. attachmentSelector opens the dialog, since its classname and property are mandatory: it writes the choice into an object property, which the picker does not, so the difference is by design. |
| L2 doc-parameters | OK | the new documentation lists the four parameters, none mandatory, with the default 20 of limit. It gives no default for filter, which the descriptor declares as an empty list, the same meaning, and the current page for target, which is what an empty target does. |
| L3 doc-example | OK | the most common example is {{attachmentGalleryPicker id="illustration" filter="image/*"/}} , the "Pick an Image" example of the documentation, closest to the only use in XWiki Standard, the attachment tab of the image dialog, {{attachmentGalleryPicker filter="image/*" target="..."/}} . Every example of the documentation renders without error. |
| I1 pattern | OK | compared with children, the reference generator: both are inserted by their Quick Action without a dialog, and through the Insert Macro dialog with an Edit Macro dialog whose fields are all optional. |
| I2 zero-config | OK | Quick Actions and the Edit Macro dialog submitted with the default values insert {{attachmentGalleryPicker/}} . View mode shows the search field, with the Current Page scope selected, and "No result." in a warning box on a page without attachments, which explains the empty result. The editor shows only the "macro:attachmentGalleryPicker" placeholder, see E1. |
| I3 instant | N/A | |
| I4 cursor | N/A | |
| I5 focus | OK | the macro has no mandatory parameter, and its four fields are visible without scrolling, with the focus on the first one, Filter. |
| E1 wysiwyg | KO | the editor shows only the generic "macro:attachmentGalleryPicker" placeholder, while view mode shows the search field, the Current Page and All Pages buttons and the grid of attachments: the grid is built by JavaScript that does not run in the editor. To reproduce: insert {{attachmentGalleryPicker id="illustration" filter="image/*"/}} , see XWIKI-23036. |
| E2 errors | KO | invalid values are accepted silently or give a message that does not name the parameter. {{attachmentGalleryPicker limit="abc"/}} and {{attachmentGalleryPicker limit="0"/}} show 20 attachments, {{attachmentGalleryPicker limit="-3"/}} shows an empty picker and the notification "The attachments search query failed.", {{attachmentGalleryPicker filter="pictures"/}} shows "No result." in both scopes, and {{attachmentGalleryPicker target="NoSuch.Page"/}} shows "No result." for the current page, with no message about the page. |
| E3 nesting | KO | in a list item and in a table cell, like * {{attachmentGalleryPicker id="illustration" filter="image/*"/}} , the macro is inline and renders "The [attachmentGalleryPicker] macro is a standalone macro and it cannot be used inline." in the editor and in view mode. In a box it works. |
| E4 inline-support | OK | the macro declares no inline support, and its output is a block widget, a search field above a grid of previews, which cannot be inside a sentence. The documentation says so. |
| E5 empty | N/A | |
| E6 inplace | N/A |
Parameters
| Parameter | C1 clarity | C2 mandatory | C3 defaults | C4 input-assistance | C5 groups | C6 order | C7 alternatives | C8 advanced | C9 technical | C13 constraints | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| filter | OK | OK | KO | KO | OK | OK | N/A | OK | OK | KO | C1: "mimetypes" is a technical term, OK since the macro targets developers, and the description gives an example of the expected value. C3, minor: the field opens empty, which means every attachment, while the most common example, and the only use in XWiki Standard, sets image/*. Neither the field nor the description says that an empty filter keeps every type. C4: a plain text field for a comma separated list of media types, where a select of common types with several values, like Images or PDF, could be used. For example, typing "pictures" is accepted and gives "No result.". C13, minor: the list of media types declares no format, so the dialog accepts any text, like "pictures". |
| id | KO | OK | OK | OK | OK | OK | N/A | OK | OK | N/A | C1: "The id of the attachment picker macro" does not say what the id is for: it is set as the HTML id of the rendered element, so that a script can reach the picker and listen to its selection events, which only the documentation says. |
| limit | OK | OK | OK | KO | OK | OK | N/A | OK | OK | KO | C4: a plain text field for a number of attachments, where a number field could be used. For example, typing "abc" is accepted and shows 20 attachments. C13: limit is an Integer with no declared range, so the dialog accepts 0 and negative values: {{attachmentGalleryPicker limit="-3"/}} shows an empty picker and "The attachments search query failed.". |
| target | KO | OK | OK | OK | OK | OK | N/A | OK | OK | OK | C1: the name is the parameter ID, "target", capitalized by the dialog, and neither the name nor the description has a translation key, so the French and German dialogs show "Target" and the English description. "The reference to the document serving as the current document" does not say that it decides which page the Current Page scope searches and which selections show the warning. To reproduce: open the Edit Macro dialog in French. C3: no default is declared, but the field opens empty, which means the current page, the value of the most common example. C4: a page picker, which finds "Sandbox" when typing it. C13: the page picker builds a valid reference, so the dialog does not need to reject a typed value. |
Other notes
Other notes: the macro is a developer building block, documented under the developer documentation, but it is neither hidden nor in the Internal category, so every user sees it in Quick Actions and the Insert Macro dialog, where inserting it alone gives a picker whose selection is lost. The audit treats it as a developer macro, as its category says.
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.
| KO | Criterion | Existing tickets | New tickets |
|---|---|---|---|
| D1 | D1 wording | XWIKI-25473 | |
| D2 | D2 summary | XWIKI-25473 | |
| D4 | D4 quick-action | XWIKI-25444 | |
| E1 | E1 wysiwyg | XWIKI-23036 (partial) | XWIKI-25523 (partial), XWIKI-25524 |
| E2 | E2 errors | XCOMMONS-3847 (partial), XRENDERING-823 (partial), XWIKI-25581 (partial) | |
| E3 | E3 nesting | XWIKI-23501 | |
| C3:filter | C3 defaults, filter | XWIKI-23759 | |
| C4:filter | C4 input-assistance, filter | XWIKI-23045 (partial) | XWIKI-25499 |
| C13:filter | C13 constraints, filter | XWIKI-25509 | |
| C1:id | C1 clarity, id | XWIKI-25473 | |
| C4:limit | C4 input-assistance, limit | XWIKI-25182 | |
| C13:limit | C13 constraints, limit | XWIKI-25182 | |
| C1:target | C1 clarity, target | XWIKI-6061 (partial) | XWIKI-25473 |
Tickets
| Ticket | Origin | KOs covered | KOs partly covered |
|---|---|---|---|
| XWIKI-23036 | Existing | E1 | |
| XWIKI-23501 | Existing | E3 | |
| XWIKI-23759 | Existing | C3:filter | |
| XWIKI-25182 | Existing | C13:limit C4:limit | |
| XWIKI-6061 | Existing | C1:target | |
| XCOMMONS-3847 | New | E2 | |
| XRENDERING-823 | New | E2 | |
| XWIKI-25444 | New | D4 | |
| XWIKI-25473 | New | C1:id D1 D2 C1:target | |
| XWIKI-23045 | Existing | C4:filter | |
| XWIKI-25499 | New | C4:filter | |
| XWIKI-25509 | New | C13:filter | |
| XWIKI-25523 | New | E1 | |
| XWIKI-25524 | New | E1 | |
| XWIKI-25581 | New | E2 |
Known issues of this macro
| Issue | Title | Status | Criteria |
|---|---|---|---|
| XWIKI-23036 | AttachmentGalleryPicker macro WYSIWYG: The buttons in the picker should not be interactable in edit mode | Open | E1 |
68 more known issues affect every macro: see the Known issues.
Lucas Charpentier