User tests: Successful: Unsuccessful:
Pull Request resolves #48753 .
Related to #48690.
When an article is updated with PATCH /api/index.php/v1/content/articles/{id} and the body contains articletext, the change is ignored. For PATCHthe controller fills all fields missing from the request with the stored values, including introtext and fulltext. Content::bind() splits articletext into introtext/fulltext, but parent::bind() then overwrites them with the stored values.
This PR removes the stored introtext and fulltext from the data on PATCH when articletext is sent and those fields are not in the request. articletext already works on POST.
X).curl -X PATCH -H "X-Joomla-Token: <token>" -H "Content-Type: application/json" \
-d '{"articletext":"<p>New intro</p><hr id=\"system-readmore\"><p>New full text</p>"}' \
http://<site>/api/index.php/v1/content/articles/X
title or only introtext still worksas before.Response is 200, but the article text is unchanged and no new version is stored.
The intro text is "New intro", the full text is "New full text", and a newversion is stored. PATCH with other fields is unchanged. If introtext and articletext are both sent, introtext wins, same as on POST.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Title |
|
||||||
I have tested this item ✅ successfully on 4e0d3aa
Hello @shamsbd71, I was able to successfully confirm/test this PR fix. I used Bruno v4.3 on Mac. Thank you for your contribution!
I have tested this item ✅ successfully on 4e0d3aa
Hello @shamsbd71, I was able to successfully confirm/test this PR fix. I used Bruno v4.3 on Mac. Thank you for your contribution!
please read comment #48753 (comment)