Create an article
POST /api/index.php/v1/content/articles {"alias": "new-article","articletext": "<p>Hello world!</p>","catid": 2,"state": "1","metadesc": "","metakey": "","title": "New Article", "language":"*"}
Article gets created
Update article text
PATCH /api/index.php/v1/content/articles/12 {"articletext": "<p>Hello world! This works</p>"}
Article's text gets updated to be <p>Hello world! This works</p>
all html markup gets removed from the original article's text, so the text becomes Hello world!
See attachment
systeminfo-2021-09-24T05_10_52-04_00.zip
| Labels |
Added:
No Code Attached Yet
|
||
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-09-29 06:36:38 |
| Closed_By | ⇒ | alikon |
@alikon, I just tried testing the suggested solution. If I understand it correctly, I need to use fulltext or introtext instead of articletext, is that correct?
Here are the steps I ran as a simple test via Postman:
POST {{base_path}}/api/index.php/v1/content/articles {"alias": "patch-test","articletext": "<p>Line 1</p><p>Line 2</p><p>Line 3</p>","catid": 2,"state": "1","metadesc": "","metakey": "","title": "Patching doesn't work.", "language":"*"}-> Article with id 29 gets created as expected with 3 lines as text:
Line 1
Line 2
Line 3
fulltextPATCH {{base_path}}/api/index.php/v1/content/articles/29 {"fulltext":"<p>Line 1</p><p><strong>Line 2</strong></p><p>Line 3</p>"}<strong> markup around Line 2)-> All markup gets removed, and the content gets duplicated:
Line 1Line 2Line 3 Line 1Line 2Line 3
introtextPATCH {{base_path}}/api/index.php/v1/content/articles/29 {"introtext":"<p>Intro here</p>"}->Markup still missing, but the first part of the text gets replaced
Intro here Line 1Line 2Line 3
What am I missing in my requests? Any help much appreciated.
No, I didn't realize it wasn't merged. After applying these changes, everything worked as expected! Thank you.
can you please mark successfully tested via https://issues.joomla.org/tracker/joomla-cms/35086
thanks in advance
please see #35086