Documentation Required bug PR-4.3-dev ? Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
25 Jul 2023

Pull Request for Issue #41194 .

Summary of Changes

Fixing Calendar::filter, to work correctly with non numeric dates.

Testing Instructions

Apply patch.
Add calendar field somewhere:

<field type="calendar" name="nextdate"  format="%a %e %b %Y" filterformat="D j M Y" 
  translateformat="false" filter="server_utc"
  showtime="false" label="Next Date" />

Try edit the date with this field.

Actual result BEFORE applying this Pull Request

Date does not saved

Expected result AFTER applying this Pull Request

Date saved

Link to documentations

Please select:

avatar joomla-cms-bot joomla-cms-bot - change - 25 Jul 2023
Category Libraries
avatar Fedik Fedik - open - 25 Jul 2023
avatar Fedik Fedik - change - 25 Jul 2023
Status New Pending
avatar brianteeman
brianteeman - comment - 25 Jul 2023

Documentation for this is required as there is no mention of filterformat https://docs.joomla.org/Calendar_form_field_type

avatar Fedik
Fedik - comment - 25 Jul 2023

Yea, but it not for this PR, it is somehow missed earlier.
I just fixing what already there.

avatar Fedik Fedik - change - 25 Jul 2023
The description was changed
avatar Fedik Fedik - edited - 25 Jul 2023
avatar Fedik Fedik - change - 25 Jul 2023
The description was changed
avatar Fedik Fedik - edited - 25 Jul 2023
avatar Fedik
Fedik - comment - 25 Jul 2023

Okay, I update the description, or it will be forgoten. does not hurt anyway.

avatar chmst
chmst - comment - 27 Jul 2023

I used the publish_up and publish_down field in com_content article.

Maybe it is the environment or another error in my xml but for me it does not work (tried different combination of attributes as well)

local, Xampp, Win 11, php 8.2,

grafik

Input
grafik

Result:
Works ine with englisch language. both fields have the required date format and are correct in the database.

But switching to german:
The first value, publish_up works but for publish_down I get:

grafik

avatar Fedik
Fedik - comment - 27 Jul 2023

I see, the problem that PHP do not know German ?

avatar Fedik
Fedik - comment - 27 Jul 2023

As I see it works only for English "textual dates", no idea what went wrong.
does it worked in past?

Numeric dates should work for every language.

avatar chmst
chmst - comment - 27 Jul 2023

Strange and I don't find a logic behind. Because I have two fields publish_up and publish_down. Publish_up works, publish_down throws this error.
Befor the patch I don't get an error, but as the issue says, the field is not stored at all.
Can you test it with your language?

Maybe it depends on the first character of the days name?

For numeric data I never had problems

avatar Fedik
Fedik - comment - 27 Jul 2023

The reason is that

$dateTime = DateTime::createFromFormat($this->filterFormat, $value);

Can parse only English "textual" dates, like Friday 27, Jul 2023 but fail with any other language, example Freitag 27, Jul 2023 will not work.

With default format 27.07.2023 it works, because it a pure "numeric" fromat.

avatar Fedik Fedik - close - 25 Aug 2023
avatar Fedik Fedik - change - 25 Aug 2023
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2023-08-25 12:33:38
Closed_By Fedik
Labels Added: Documentation Required bug PR-4.3-dev ?
avatar Fedik
Fedik - comment - 25 Aug 2023

The bug is much complex.
I have opended an issue for now #41444.

Add a Comment

Login with GitHub to post a comment