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

Allow the page and attachment pickers to reject references to entities that don't exist

    XMLWordPrintable

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.

      Raised in https://forum.xwiki.org/t/brainstorming-usability-criteria-for-auditing-macros-in-the-wysiwyg-editor/18907

      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: