Drop the Maven XAR plugin requirement for setting the title for WebPreferences pages

edit: 2 won. Ticket opened at Loading...

There’s a rule in the Maven XAR plugin that enforces the following title for WebPreferences pages: $services.localization.render('admin.preferences.title') (“Preferences”)

IIUC, we have a sheet associated to the XWikiPreferences object that sets the title to $services.localization.render('administration.title.page') (“Page Administration”)

I suggest we change the rule so it checks:

  1. Whether the title is not set, or set to one of these two (for backward compatibility) for WebPreferences pages, and also for XWikiPreferences (with the corresponding translation strings), or
  2. That the title is not set (which will make all extension developers remove the title from all their WebPreferences / XWikiPreferences pages - which will allow the platform to fully manage the title of WebPreferences pages), or
  3. We remove the rule entirely (for both WebPreferences and XWikiPreferences pages) (with the risk that people set titles hardcoded to the language they currently use in their XWiki instance)

The rationale behind this proposal is that:

  • we shouldn’t require users to hardcode some arbitrary translation string they should not have to care about in their projects
  • in any case this is not needed (anymore?) anyway
  • Worse than that, apparently it’s causing inconsistencies between WebPreferences pages created on the instance directly, and those imported from a XAR package

WDYT?

I’l open the vote for until the end of the month and create a ticket for that with the preferred option if they are not vetoed.

+1, that’s the cleanest IMO.

I’m fine with 3. too, but since the point of that rule was consistency, let’s keep the spirit of it and impose what’s the cleanest (so empty, since that title is actually not used in the UI currently).

Are you sure that the title will be displayed correctly in LTs/LDs if not set explicitly?

AFAIK the LT/LD support titles coming from sheets.

Really? You can sort and filter on that? I’m surprised but that’s good if it’s the case.

I meant for the display (since that was your question).

I have the feeling that you skipped the fact that the title which is currently forced in each WebPreferences is a script, so I’m not sure how this is easier to sort and filter.

Right, I missed that. It’s $services.localization.render('admin.preferences.title') most of the time and that makes the LD not like it too much.

BTW, seems we have some fixing to do as this is not consistently used:

Seems to be coming from the sheet since the titles are the same.

So I’ve tested it and it doesn’t seem to work as you say. I’ve removed the title from from CKEditor.WebPreferences page and I now get bad titles:

And:

Thx

That page name is a bit missleading since apparently it actually does not contain any XWikiPreferences object :slight_smile:

Try with XWiki.WebPreferences.

When the admin UI create the WebPreferences page, it always set the XWikiPreference object in it (even when you only went to the right management), so I assumed all our WebPreferences pages had one. Among other things, the XWikiPreferences sheet also automatically redirect you to the admin UI of the page.

So I guess proposal 2. would also mean adding a rule to make sure there is an XWikiPreferences object…

1 Like

haha, indeed.

So it does seem to work.

So +1 for option 2.

Thx

+1 for option 2.

Thanks,
Marius

+1 for option 2, thanks

+1 for option 2.

Thanks,
Alex