diff --git a/api/components/com_content/src/Controller/ArticlesController.php b/api/components/com_content/src/Controller/ArticlesController.php index 8c972f9431168..a673a800bbacd 100644 --- a/api/components/com_content/src/Controller/ArticlesController.php +++ b/api/components/com_content/src/Controller/ArticlesController.php @@ -137,6 +137,17 @@ protected function preprocessSaveData(array $data): array $data['tags'] = explode(',', $tags->tags); } + // On PATCH the stored introtext and fulltext would overwrite the text split from articletext + if (($this->input->getMethod() === 'PATCH') && isset($data['articletext'])) { + $requestData = $this->input->get('data', json_decode($this->input->json->getRaw(), true), 'array'); + + foreach (['introtext', 'fulltext'] as $field) { + if (!\array_key_exists($field, $requestData)) { + unset($data[$field]); + } + } + } + return $data; } }