Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
Unknown
-
Description
The page and attachment pickers accept any typed value, including a reference to a page or attachment that does not exist. The page picker hard-codes create: true in suggestPages.js. For some uses this is expected, for example pointing to a page that is going to be created. For others it is always a mistake, for example the page to include or display, and the user only finds out once the content is rendered.
The same need was discussed for the user and group pickers in XWIKI-13279, where the conclusion was that an option would be useful but the default behaviour should not change.
Proposal
- Add an option to the page and attachment pickers, read from a data-* attribute like their other options, that controls whether references to non-existing entities are allowed.
- Default: allowed, so that every existing use of the pickers keeps its current behaviour.
- When not allowed and the value points to an entity that does not exist, mark the field as invalid with an error message next to it. Use the standard constraint validation (setCustomValidity) so that any form running the browser validation, including the Edit Macro dialog after XWIKI-25182, refuses to submit.
- Typing a reference stays possible in both modes, for example to paste one. The check runs on the entered value.
- The error must be the same whether the entity does not exist or the current user cannot view it, so that the picker does not reveal the existence of pages the user cannot see.
Using this option from a macro parameter is a separate step.
Attachments
Issue Links
- is related to
-
XWIKI-13279 Non-existing user/group can be added by user/group suggest
-
- Closed
-
-
XWIKI-25182 Numeric macro parameters accept any text in the Edit Macro dialog
-
- Open
-