No Code Attached Yet J4 Issue bug
avatar marcodings
marcodings
14 Sep 2019

screen shot 2019-09-14 at 09 34 45

Steps to reproduce the issue

edit the creation date of an article(1), NOT using the date picker
The supported format is YYYY-MM-DD

Now we enter a date as DD-MM-YYYY

Expected result

Error message indicating the format is wrong "YYYY-MM-DD" expected, found "XX-XX-DDDD"

Actual result

(3) the date is stored without warning or error but its a totally unreleated date, 2011-03-12.
This is particulary bad when using "save & close".

System information (as much as possible)

j3.9.11

Additional comments

There should be a warning against a wrong pattern. Starting with 4digits is a clear violation. And yes i am aware that there is limited possibilities in distinguishing DD and YY for all usescases.

I first experienced this problem in a propriataray where users enter birthdates. Using the "articles" makes it easier to reproduce

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar marcodings marcodings - open - 14 Sep 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 14 Sep 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Sep 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 14 Sep 2019
avatar marcodings
marcodings - comment - 14 Sep 2019

This behavious seems to be the same in J4 (at least not the latest alfa). I will confirm (or debunk) this for the current alfa
screen shot 2019-09-14 at 09 53 47


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26296.
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Sep 2019
Status New Discussion
avatar brianteeman
brianteeman - comment - 14 Sep 2019

I think we had this before and it was related to a broken localise.php in the language pack.

avatar marcodings
marcodings - comment - 14 Sep 2019

From my initial investigations it is a JS issue caused by the (ancient) datepicker JS library

avatar Bakual
Bakual - comment - 14 Sep 2019

It's not the same issue we had previously. Back then it was a wrong language string which broke it.
But here it is about validation of the input.
I'd say it should be possible to validate the format of the input using JavaScript and give that expected error message, but I'm the wrong guy to code that.

avatar brianteeman
brianteeman - comment - 14 Sep 2019

It's not the same issue we had previously. Back then it was a wrong language string which broke it.
Ah ok - knew i remembered something

avatar marcodings
marcodings - comment - 17 Sep 2019

So i finally got around to checkin it in alfa11

screen shot 2019-09-17 at 11 59 24

as can be seen the behaviour is the same erro for J4. @dgrammatiko any insights?


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

avatar marcodings
marcodings - comment - 19 Sep 2019

Library used is JSCal2 by Mihai Bazon
media/system/js/calendar.js
$Id: calendar.js,v 1.51 2005/03/07
Onlyu documentatino is online: http://www.dynarch.com/jscal/


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

avatar TLWebdesign
TLWebdesign - comment - 20 Sep 2019

Marco have you checked your DB as to what is stored? Because i am having a somewhat similar problem with a JCB component and it displays a seemingly random date but when i check the db it has my default value saved 0000-00-00 instead of the date. Wondering if this is happening here also.

avatar povinsahu1909
povinsahu1909 - comment - 6 Oct 2019

I am new to open source and want to contribute to this issue. I observed that calender field set random value when given value in other format and even time field set value to 00:00:00 when not provided.
I am thinking that this problem can be overcome by defining new class that validate date and not set default time. For valid input placeholder can be there in every input field specifying correct format to be entered

avatar Fedik
Fedik - comment - 6 Oct 2019

in theory it already should be "validated" by date_parse_from_format, but it seem the result are ignored.
did you had any PHP notices?

links
https://www.php.net/manual/en/function.date-parse-from-format.php
https://www.php.net/manual/en/datetime.createfromformat.php

avatar marcodings
marcodings - comment - 8 Oct 2019

It is the JS ( of the calendar) that changes the date before posting the
form. php is not involved

On Sun, 6 Oct 2019 at 15:08, Fedir Zinchuk notifications@github.com wrote:

in theory it already should be "validated"
https://github.com/joomla/joomla-cms/blob/2271541/libraries/src/Form/Form.php#L1324
by date_parse_from_format, but it seem the result are ignored.
did you had any PHP notices?

links
https://www.php.net/manual/en/function.date-parse-from-format.php
https://www.php.net/manual/en/datetime.createfromformat.php


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/joomla/joomla-cms/issues/26296?email_source=notifications&email_token=AA2SUPTP6QQWHSASNMSPC6LQNHPMNA5CNFSM4IWWRHHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAOJV4Y#issuecomment-538745587,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA2SUPTAQJKUTUVXANQ5OZDQNHPMNANCNFSM4IWWRHHA
.

avatar brianteeman
brianteeman - comment - 23 Aug 2022

Can someone please change the label to J4 Issue as its still an issue

avatar zero-24 zero-24 - change - 23 Aug 2022
Labels Added: No Code Attached Yet J4 Issue
Removed: J3 Issue ?
avatar zero-24 zero-24 - unlabeled - 23 Aug 2022
avatar zero-24 zero-24 - labeled - 23 Aug 2022
avatar zero-24
zero-24 - comment - 23 Aug 2022

Done

avatar Hackwar Hackwar - change - 19 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 19 Feb 2023

Add a Comment

Login with GitHub to post a comment