No Code Attached Yet
avatar MayaSima
MayaSima
28 Sep 2021

Steps to reproduce the issue

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>"}

Expected result

Article's text gets updated to be <p>Hello world! This works</p>

Actual result

all html markup gets removed from the original article's text, so the text becomes Hello world!

System information (as much as possible)

See attachment
systeminfo-2021-09-24T05_10_52-04_00.zip

Additional comments

avatar MayaSima MayaSima - open - 28 Sep 2021
avatar joomla-cms-bot joomla-cms-bot - change - 28 Sep 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 Sep 2021
avatar alikon
alikon - comment - 28 Sep 2021

please see #35086

avatar alikon alikon - change - 29 Sep 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-09-29 06:36:38
Closed_By alikon
avatar alikon alikon - close - 29 Sep 2021
avatar MayaSima
MayaSima - comment - 29 Sep 2021

@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:

  1. Create a new article
    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

  1. Patch the article with the updated fulltext
    PATCH {{base_path}}/api/index.php/v1/content/articles/29 {"fulltext":"<p>Line 1</p><p><strong>Line 2</strong></p><p>Line 3</p>"}
    (I have added <strong> markup around Line 2)

-> All markup gets removed, and the content gets duplicated:
Line 1Line 2Line 3 Line 1Line 2Line 3

  1. Patch the article with the updated introtext
    PATCH {{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.

avatar alikon
alikon - comment - 29 Sep 2021

did you apply first the #35086 ?

avatar MayaSima
MayaSima - comment - 30 Sep 2021

No, I didn't realize it wasn't merged. After applying these changes, everything worked as expected! Thank you.

avatar alikon
alikon - comment - 30 Sep 2021

can you please mark successfully tested via https://issues.joomla.org/tracker/joomla-cms/35086
thanks in advance

Add a Comment

Login with GitHub to post a comment