Closed skjnldsv closed 1 month ago
Hmmmmm, I might have misunderstood the rfc as @susnux pointed me out.
I think the rfc never covered nested properties updates. It's all replace or delete.
To Achieve what I want with the example in the OP, the <D:set>
would be enough as it would overwrite any existing content, kicking <Z:Author>John Patson</Z:Author>
out already :thinking:
https://datatracker.ietf.org/doc/html/rfc4918#section-14.26
Description: The 'set' element MUST contain only a 'prop' element. The elements contained by the 'prop' element inside the 'set' element MUST specify the name and value of properties that are set on the resource identified by Request-URI. If a property already exists, then its value is replaced. Language tagging information appearing in the scope of the 'prop' element (in the "xml:lang"
Important part: If a property already exists, then its value is replaced
Propatch example
Reference: http://www.webdav.org/specs/rfc2518.html#rfc.section.8.2.2
Issue
When executing this proppatch request, the property gets nullified by the way we handle proppatch in sabre/dav. https://github.com/sabre-io/dav/blob/a6ff5932012d5064b4c04b4543be7c3d119a5199/lib/DAV/Xml/Request/PropPatch.php#L95-L105
Suggestion
I suggest creating a new array for removed properties
We can keep the legacy way of nullifying, but stop nullifying if we have the same root prop in both
d:set
andd:remove