Skip to content

Commit

Permalink
Use ObjectModel->setFieldsToUpdate when using PATCH request
Browse files Browse the repository at this point in the history
  • Loading branch information
kpodemski committed Nov 17, 2024
1 parent 92e9262 commit bc65b84
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/webservice/WebserviceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,11 @@ protected function saveEntityFromXml($successReturnCode)
if (isset($this->resourceConfiguration['objectMethods']) && array_key_exists($objectMethod, $this->resourceConfiguration['objectMethods'])) {
$objectMethod = $this->resourceConfiguration['objectMethods'][$objectMethod];
}

if ($this->method == 'PATCH') {
$object->setFieldsToUpdate(array_fill_keys(array_keys((array) $attributes), true));
}

$result = $object->{$objectMethod}();
if ($result) {
if (isset($attributes->associations)) {
Expand Down

0 comments on commit bc65b84

Please sign in to comment.