This issue has been created
 
 
XWiki Rendering / cid:jira-generated-image-avatar-5121fc56-c46a-473a-8ea0-a1f417f80932 XRENDERING-828 Open

Provide an image picker for the image parameter of the box and message macros

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-c41ef918-8337-41f4-84c2-35d139d6ed4b Charpentier Lucas created this issue on 23/Oct/26 10:24
 
Summary: Provide an image picker for the image parameter of the box and message macros
Issue Type: cid:jira-generated-image-avatar-5121fc56-c46a-473a-8ea0-a1f417f80932 Improvement
Affects Versions: 17.10.14, 18.8.0
Assignee: Unassigned
Components: Macro - Box, Macro - Message
Created: 23/Oct/26 10:24
Priority: cid:jira-generated-image-static-major-45343750-7f7d-4eff-8fd9-6c0c14e6d7d7 Major
Reporter: Charpentier Lucas
Description:

The image parameter of the box and message macros is a plain text field in the Edit Macro dialog, so the user has to type the reference of an image they cannot browse for, and a reference to an attachment that does not exist is accepted silently.

The macros to change, with the file where most of the fix is done:

  • box, info, warning, error and success: parameters declared in BoxMacroParameters.java, shared by the five macros.

The main problems:

  • The parameter is typed as a resource reference, but declares no display type, so the dialog gives it no picker: the user can neither browse the attachments of the page nor upload an image.
  • A reference to a missing attachment is accepted by the dialog and, once rendered, gives a broken image with no message, so the user does not know that the reference is wrong.

The office macro already gives a resource reference parameter an attachment picker, through a display type declared in OfficeMacroParameters.java and its edit displayer, which keeps the upload and restricts the files to the expected types. The same could be done for images.

KOs covered

Macro Criterion Parameter Problem
box C4 input-assistance image A free text field, with no image picker, although the type is a resource reference; a reference to a missing attachment is accepted.
error C4 input-assistance image A free text field, with no image picker; a reference to a missing attachment is accepted.
info C4 input-assistance image A free text field, with no image picker; a reference to a missing attachment is accepted.
success C4 input-assistance image A free text field, with no image picker; a reference to a missing attachment is accepted.
warning C4 input-assistance image A free text field, with no image picker; a reference to a missing attachment is accepted.

Impact found on macro fluidity

These 5 KOs come from the WYSIWYG usability audit of the macros, under the criterion C4 input-assistance of its usability criteria. The page of each macro, linked in the table, has the full notes and the steps to reproduce. Fixing them means changing the declaration of the image parameter in the macro definitions.

This issue also covers part of the E2 errors KO of the same five macros: image="missing.png" renders a broken image, with no attachment missing.png on the page and no message. The other invalid values of that KO are covered elsewhere, the width by XRENDERING-826 and the status by XCOMMONS-3847.