RTC bug Webservices PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar TLWebdesign
TLWebdesign
28 Sep 2026

On a PATCH request the fields that are not sent are filled from the stored record, which holds dates in UTC. The SERVER_UTC and USER_UTC form filters then convert these values to UTC a second time, so every update moves them by the timezone offset. Keep the stored value for those fields.

Pull Request resolves #48518.

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

On a PATCH request, ApiController::save() fills the fields that are not sent with the values of the stored record. Stored dates are in UTC, but the SERVER_UTC / USER_UTC form filters then treat them as local time and convert them to UTC again. As a result every PATCH moves dates such as created, publish_up and publish_down of an article (or created_time of a category) by the timezone offset, even when they are not part of the request.

This PR keeps the stored value for those fields after validation. Dates that are sent in the request are filtered as before.

Testing Instructions

  1. Set the Website Time Zone in the Global Configuration (or the time zone of the API user) to a zone other than UTC, for example Europe/Amsterdam.
  2. Create an article and note its Created and Start Publishing dates.
  3. Update only the title with the API:
    PATCH /api/index.php/v1/content/articles/{id}
    {"title": "New title"}
    
  4. Check the Created and Start Publishing dates of the article again. Repeat step 3 a few times.

Actual result BEFORE applying this Pull Request

Every PATCH moves the Created, Start Publishing and Finish Publishing dates by the timezone offset (1 hour in winter, 2 hours in summer for Europe/Amsterdam), even though they were not sent.

Expected result AFTER applying this Pull Request

Dates that are not sent in the PATCH request are not changed. Dates that are sent are still converted from the user's time zone to UTC, as before.

Link to documentations

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

avatar TLWebdesign TLWebdesign - open - 28 Sep 2026
avatar TLWebdesign TLWebdesign - change - 28 Sep 2026
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Sep 2026
Category ⇒ Libraries
avatar TLWebdesign TLWebdesign - change - 28 Sep 2026
Title
…
[AI] [5.4] Fix dates shifting by the timezone offset on API PATCH
[5.4] [AI] Fix dates shifting by the timezone offset on API PATCH
avatar TLWebdesign TLWebdesign - edited - 28 Sep 2026
avatar muhme muhme - test_item - 2 Oct 2026 - Tested successfully
avatar muhme
muhme - comment - 2 Oct 2026

I have tested this item ✅ successfully on 859eab6

Tested with JBT

  • Used the script with five article's title PATCH calls
  • Seen before PR
    • With Website Time Zone UTC article's modify date hour and minute are correct
    • With Website Time Zone Berlin article's modify date is correct Berlin time, but article's created date and start publishing are 10 hours back in time (5 x PATCH and 2 hours timezone difference)
  • Applied PR with Patch Tester
    • Start Publishing and Created Date are untouched, Modified Date is set correctly
    • It is still possible to set article's Created Date
      • api_call "PATCH" "/v1/content/articles/${id}" -d '{"title": "changed", "created" : "2026-01-01 12:00:00" }'
    • It is still possible to set article's Start Publishing with PATCH publish_up API call
    • It is still possible to set article's Finish Publishing with PATCH publish_down API call
    • Set Website Time Zone back to UTC
      • New article's Created Date, Start Publishing and Modified Date are correct
      • After five article title PATCH calls, article's Created Date, Start Publishing and Modified Date are correct
      • It is still possible to set article's Created Date, Start Publishing and Finish Publishing correctly with API PATCH calls
    • No unusual PHP or Joomla log messages

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48519.
avatar muhme
muhme - comment - 2 Oct 2026

I have tested this item ✅ successfully on 859eab6

Tested with JBT

  • Used the script with five article's title PATCH calls
  • Seen before PR
    • With Website Time Zone UTC article's modify date hour and minute are correct
    • With Website Time Zone Berlin article's modify date is correct Berlin time, but article's created date and start publishing are 10 hours back in time (5 x PATCH and 2 hours timezone difference)
  • Applied PR with Patch Tester
    • Start Publishing and Created Date are untouched, Modified Date is set correctly
    • It is still possible to set article's Created Date
      • api_call "PATCH" "/v1/content/articles/${id}" -d '{"title": "changed", "created" : "2026-01-01 12:00:00" }'
    • It is still possible to set article's Start Publishing with PATCH publish_up API call
    • It is still possible to set article's Finish Publishing with PATCH publish_down API call
    • Set Website Time Zone back to UTC
      • New article's Created Date, Start Publishing and Modified Date are correct
      • After five article title PATCH calls, article's Created Date, Start Publishing and Modified Date are correct
      • It is still possible to set article's Created Date, Start Publishing and Finish Publishing correctly with API PATCH calls
    • No unusual PHP or Joomla log messages

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48519.
avatar muhme
muhme - comment - 2 Oct 2026

I have tested this item ✅ successfully on 859eab6

Tested with JBT

  • Used the script article.sh with five article's title PATCH calls
  • Seen before PR
    • With Website Time Zone UTC article's modify date hour and minute are correct
    • With Website Time Zone Berlin article's modify date is correct Berlin time, but article's created date and start publishing are 10 hours back in time (5 x PATCH and 2 hours timezone difference)
  • Applied PR with Patch Tester
    • Start Publishing and Created Date are untouched, Modified Date is set correctly
    • It is still possible to set article's Created Date
      • api_call "PATCH" "/v1/content/articles/${id}" -d '{"title": "changed", "created" : "2026-01-01 12:00:00" }'
    • It is still possible to set article's Start Publishing with PATCH publish_up API call
    • It is still possible to set article's Finish Publishing with PATCH publish_down API call
    • Set Website Time Zone back to UTC
      • New article's Created Date, Start Publishing and Modified Date are correct
      • After five article title PATCH calls, article's Created Date, Start Publishing and Modified Date are correct
      • It is still possible to set article's Created Date, Start Publishing and Finish Publishing correctly with API PATCH calls
    • No unusual PHP or Joomla log messages

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48519.
avatar richard67 richard67 - change - 2 Oct 2026
Labels Added: PR-5.4-dev
avatar richard67 richard67 - alter_testresult - 2 Oct 2026 - muhme: Tested successfully
avatar alikon alikon - test_item - 2 Oct 2026 - Tested successfully
avatar alikon
alikon - comment - 2 Oct 2026

I have tested this item ✅ successfully on 9a2231e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48519.

avatar alikon
alikon - comment - 2 Oct 2026

I have tested this item ✅ successfully on 9a2231e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48519.

avatar alikon alikon - change - 2 Oct 2026
Status Pending ⇒ Ready to Commit
avatar alikon
alikon - comment - 2 Oct 2026

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48519.

avatar alikon
alikon - comment - 2 Oct 2026

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48519.

avatar richard67 richard67 - change - 2 Oct 2026
Labels Added: RTC bug Webservices
avatar richard67 richard67 - close - 2 Oct 2026
avatar richard67 richard67 - merge - 2 Oct 2026
avatar richard67 richard67 - change - 2 Oct 2026
Status Ready to Commit ⇒ Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 ⇒ 2026-10-02 17:05:45
Closed_By ⇒ richard67
avatar richard67
richard67 - comment - 2 Oct 2026

Thanks @TLWebdesign for this PR, and @muhme and @alikon for testing.

avatar TLWebdesign TLWebdesign - change - 2 Oct 2026
The description was changed
avatar TLWebdesign TLWebdesign - edited - 2 Oct 2026

Add a Comment

Login with GitHub to post a comment