Skip to content

Comments

XWIKI-23828: extend setWikiPreference to update several preferences a…#5180

Draft
Sereza7 wants to merge 1 commit intoxwiki:masterfrom
Sereza7:XWIKI-23828
Draft

XWIKI-23828: extend setWikiPreference to update several preferences a…#5180
Sereza7 wants to merge 1 commit intoxwiki:masterfrom
Sereza7:XWIKI-23828

Conversation

@Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Feb 12, 2026

Jira URL

Changes

Description

  • Added the new util method.
  • Updated two tests to use it instead of multiple calls to setWikiPreference

Clarifications

  • The two test updates are not needed to solve the ticket, but it's a good way to check that the new util actually works.

Screenshots & Video

None, test change only.

Executed Tests

Built the main change with mvn clean install -f xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui -Pquality successfully.
After that, I updated some docker tests where using this new util would make sense and ran them:

  • mvn clean install -f xwiki-platform-core/xwiki-platform-edit/xwiki-platform-edit-test/xwiki-platform-edit-test-docker
  • mvn clean install -f xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-test/xwiki-platform-flamingo-skin-test-docker -Dit.test=DeletePageIT

Both docker test builds passed successfully even with the changes.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • 17.10.X. This is a test only change, it does not have any impact on the distribution.

…t once

* Added the new util method.
* Updated two tests to use it instead of multiple calls to setWikiPreference
public void setWikiPreferences(Map<String, String> properties) throws Exception
{
for (Map.Entry<String, String> entry : properties.entrySet()) {
setWikiPreference(entry.getKey(), entry.getValue());
Copy link
Member

@tmortagne tmortagne Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of this implementation honestly. I would have done the opposite: save all properties in a single save, and make setWikiPreference(String propertyName, String value) call the new method with a map containing only one entry.

@Sereza7 Sereza7 marked this pull request as draft February 13, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants