? Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
16 Dec 2021

Pull Request for Issue #30343.

Summary of Changes

In short: When using a custom field of type calendar in an article and changing the category of said article, the time is changed of the custom field.

In long: When a site/user has a different timezone than UTC and has a custom field of type calendar for his articles and then, when editing such an article, changes its category, the page reloads and processes the data on that reload. In theory the filtered data should be stored to the session and we have according code in FormController around line 950. However that code only checks the first level of the $data array. Custom fields however are in a subarray, which lets this fail.
IMPORTANT: THIS ONLY FIXES THIS FOR THE FIRST LEVEL OF THE SUBARRAY! That means, when you have a form that has a fields tag inside a fields tag inside a fields tag, this issue still exists. I don't know yet how to solve this properly! Help is welcome here.

This is the fix for 3.10, but this issue is most likely also present in 4.0! For 4.0 I would actually expect the field to handle this directly, since right now this is hardcoded to the core Calendar field and thus means third party calendar fields or other fields with similar data handling have to become a lot more creative.

Testing Instructions

  1. Set the timezone of your site to something else than UTC.
  2. Create a custom field for your article of type "Calendar".
  3. Have at least 2 categories.
  4. Edit an article and set the calendar custom field to a known date and time.
  5. change the category and see the page reload on the change.

Actual result BEFORE applying this Pull Request

The time (and maybe even the date) changes by the offset to UTC.

Expected result AFTER applying this Pull Request

The time and date stay the same.

avatar Hackwar Hackwar - open - 16 Dec 2021
avatar Hackwar Hackwar - change - 16 Dec 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Dec 2021
Category Libraries
avatar toivo toivo - test_item - 28 Dec 2021 - Tested successfully
avatar toivo
toivo - comment - 28 Dec 2021

I have tested this item successfully on f45e54f

Tested successfully in 3.10.5-dev using PHP 8.0.13.


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

avatar Hackwar Hackwar - change - 20 Jan 2022
Labels Added: ?
avatar zero-24
zero-24 - comment - 23 Jan 2022

Will take this in here as workaround for 3.10 thanks!

avatar zero-24 zero-24 - close - 23 Jan 2022
avatar zero-24 zero-24 - merge - 23 Jan 2022
avatar zero-24 zero-24 - change - 23 Jan 2022
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-01-23 15:39:28
Closed_By zero-24

Add a Comment

Login with GitHub to post a comment