No Code Attached Yet
avatar Valdnet
Valdnet
2 Jan 2023

Steps to reproduce the issue

  1. Change the back-end language to Polish.
  2. Select User -> User Note.
  3. Create a new user note.
  4. Select a date, e.g. 02/01/2023.
  5. Save the note.

Expected result

Add a note with the selected date.

Actual result

1. Incorrect date reading for Polish language.

  • Date for English language:

obraz

  • Date for Polish language

obraz

  1. After changing the date to the correct one, i.e. 02/01/2023, an error occurs when saving:

obraz

System information (as much as possible)

  • Joomla 4.2.6
  • Polish language 4.2.2.2
  • Firefox 108.0.1

Additional comments

I suspect a problem with date formatting for time zones.

avatar Valdnet Valdnet - open - 2 Jan 2023
avatar joomla-cms-bot joomla-cms-bot - change - 2 Jan 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 Jan 2023
avatar brianteeman
brianteeman - comment - 2 Jan 2023

Could you please enable debug mode in the global configuration and repeat the steps you took above and then post the stack trace that will be output.

avatar Valdnet
Valdnet - comment - 3 Jan 2023

@brianteeman Below are the debugging errors:

     0 Call to a member function format() on bool 

Call stack
# 	Function 	                                               Location
1 	() 	                                                       JROOT/libraries/src/Form/Field/CalendarField.php:352
2 	Joomla\CMS\Form\Field\CalendarField->filter() 	               JROOT/libraries/src/Form/Form.php:1047
3 	Joomla\CMS\Form\Form->filter() 	                               JROOT/libraries/src/Form/Form.php:991
4 	Joomla\CMS\Form\Form->process() 	                       JROOT/libraries/src/MVC/Model/FormModel.php:213
5 	Joomla\CMS\MVC\Model\FormModel->validate() 	               JROOT/libraries/src/MVC/Controller/FormController.php:623
6 	Joomla\CMS\MVC\Controller\FormController->save() 	       JROOT/libraries/src/MVC/Controller/BaseController.php:672
7 	Joomla\CMS\MVC\Controller\BaseController->execute() 	       JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
8 	Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() 	       JROOT/libraries/src/Component/ComponentHelper.php:355
9 	Joomla\CMS\Component\ComponentHelper::renderComponent()        JROOT/libraries/src/Application/AdministratorApplication.php:143
10 	Joomla\CMS\Application\AdministratorApplication->dispatch()    JROOT/libraries/src/Application/AdministratorApplication.php:186
11 	Joomla\CMS\Application\AdministratorApplication->doExecute()   JROOT/libraries/src/Application/CMSApplication.php:294
12 	Joomla\CMS\Application\CMSApplication->execute() 	       JROOT/administrator/includes/app.php:61
13 	require_once() 	                                               JROOT/administrator/index.php:32 
avatar brianteeman
brianteeman - comment - 3 Jan 2023

Thanks for that.

I have confirmed the issue in Polish but not in other languages and it is with all calendar fields not just the one in user notes

As soon as I finish my coffee I will investigate further. I have a pretty good idea of where the problem is so it shouldnt take long

avatar brianteeman
brianteeman - comment - 3 Jan 2023

Found the problem - its a language string in the polish language pack that is not correct

DATE_FORMAT_FILTER_DATE = d-m-y
DATE_FORMAT_FILTER_DATETIME = Y-m-d H:i:s

The date format filter date needs to be in the same order as the datetime filter

If you create a language override for DATE_FORMAT_FILTER_DATE and set it to Y-m-d then it will work correctly

@tecpromotion something to inform the polish tt about

avatar wojsmol
wojsmol - comment - 4 Jan 2023

@brianteeman @Valdnet Described issue has been fixed in version 4.2.2v3 of Polish language pack with is available on https://downloads.joomla.org/language-packs/translations-joomla4/downloads/joomla4-polish/4-2-2-3 and will be available as an update.

avatar max123kl
max123kl - comment - 4 Jan 2023

@Valdnet can you close this issue as solved?

avatar Valdnet
Valdnet - comment - 4 Jan 2023

@brianteeman @wojsmol @max123kl After updating to version 4.2.2v3 of the Polish language, the problem still occurs with the date.

avatar brianteeman
brianteeman - comment - 4 Jan 2023

confirming the problem is not fixed

avatar Valdnet
Valdnet - comment - 4 Jan 2023

I noticed that in the new version 2.2.2v3 for the Polish language, the date format has not been changed according to @brianteeman instructions.

Manual editing of files and code changes:

DATE_FORMAT_FILTER_DATE="d-m-y"
DATE_FORMAT_FILTER_DATETIME="d-m-y H:i:s"

on

DATE_FORMAT_FILTER_DATE="Y-m-d"
DATE_FORMAT_FILTER_DATETIME="Y-m-d H:i:s"

ini files solves the problem.

@wojsmol is the installation package properly added?

avatar wojsmol
wojsmol - comment - 4 Jan 2023

@Valdnet @brianteeman Please post your php version.

avatar brianteeman
brianteeman - comment - 4 Jan 2023

in light of something I just saw in the language pack I withdraw from this conversation

avatar wojsmol
wojsmol - comment - 4 Jan 2023

in light of something I just saw in the language pack I withdraw from this conversation

@brianteeman What do you mean? You can message me on Mattermost.

avatar Valdnet
Valdnet - comment - 4 Jan 2023

Please post your php version.

@wojsmol My PHP version is 7.4

avatar wojtekxtx
wojtekxtx - comment - 6 Jan 2023

@brianteeman You found an easteregg ? Congrats ? I bet there are more of them........
@Valdnet just update to php:latest

avatar brianteeman
brianteeman - comment - 7 Jan 2023

Now that v4 of the language pack has been released I can confirm the issue is now solved and this can be closed

avatar Quy Quy - change - 7 Jan 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-01-07 16:47:39
Closed_By Quy
avatar Quy Quy - close - 7 Jan 2023
avatar Valdnet
Valdnet - comment - 8 Jan 2023

Works great. Thanks a lot for the fix ?.

Add a Comment

Login with GitHub to post a comment