There are 2 updates, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-41a20484-3952-4d37-b75c-bf628dd1b45d XWIKI-21417 In Progress

BaseObject#set always set the metadata dirty flag of the owner doc to true

 
View issue   ยท   Add comment
 

2 updates

 
cid:jira-generated-image-avatar-de278a2f-26f9-464e-9e79-91f99d781f42 Changes by Thomas Mortagne on 17/Apr/25 17:16
 
Assignee: Thomas Mortagne
Status: Open In Progress
 
 

1 comment

 
cid:jira-generated-image-avatar-df2ce9f2-4617-4dc9-8511-fa6dd40c5332 Simon Urli on 17/Apr/25 17:15
 
The root cause of that behaviour is the call to {{pclass#fromString}} on https://github.com/xwiki/xwiki-platform/blob/ master xwiki-platform-14.10.17 /xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/BaseObject.java#L348 since this method systematically creates a new property: since this new property has no value, setting its value makes it dirty and so the owner document metadata dirty flag is also updated.

We probably cannot get rid of this call to {{#fromString}} directly, as it provides various implementation of handling the String parameter. However, we can probably provide a new API to allow reusing an existing property, instead of creating a new one systematically.

Now note that fixing that bug might have unexpected impacts on existing extensions: I discovered that some features of CR were working by accident because of it.