Enforce page name strategy

Hi devs,

Right now, we check the page name strategy in a few places (like in the Create dialog when the user is not advanced - advanced users can specify the page name and it’s not checked, or in the WYSIWYG editor’s link dialog). In the future we’ll also check attachment name strategies (see Loading...).

However, this means that we can still have pages or attachments not following the page naming strategy. This means that for ex the Documentation extension needs to recode the page and attachment naming strategy to verify that users contributing doc pages follow the naming strategies. It would be nicer if this could be enforced by XWiki.

Maybe one first idea would that if you try to create a page not following the naming strategy (same for an attachment), we should maybe display a warning with an explanation and ask for confirmation. The use case that comes to mind would be when creating pages in existing spaces that are not following the name strategy for ex.

WDYT? Do you see other ideas of what we could do?

Thanks

Note that this sounds almost like an improvment of the “validate name before saving” feature of the name strategy, and AFAIR the reason we did not make it a default option was the UC you mentioned about existing space with names not respecting the strategy.

I’m ok with the idea: we then have 2 options, either we keep both what you propose and current validation feature that is blocking the save entirely, or we only keep your solution as an improvment of the validation feature (which means it wouldn’t always block the save).