Empty dates are save with negative value

More
5 years 7 months ago #76651 by MatGod
I have a Repeatable fieldgroup with two fields of type date. It works well for some time, but if I remove the value of one date, the date will be saved with the value -0001-11-30 05:00:00 in the database. When I refresh the page, the value will be 2019-01-12 06:00. If I save it, the new value will stay. I can also change the new value, as long that it's not empty it will work.

After some testing, I figured that emptying a field should remove it from the database (in flexicontent_fields_item_relations) but for some reason when there's too much value to remove, an update with bad value is made.

Flexicontent (v3.3.1.5)
Joomla (3.9.6)

Please Log in or Create an account to join the conversation.

More
5 years 7 months ago #76654 by ggppdk
Hello

i have tested just now and i cannot replicate this

This should not be a problem in PHP code, fieldgroup will not save empty field values
instead it saves the values with a proper index skipping values that are empty

if you open browser console
is there a JS error during form loading or when you click form submit ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
5 years 7 months ago #76655 by ggppdk
Hello

hhmm testing more
i see that Joomla date picker element will auto fill
0000-00-00
when we click submit
so this will could be the problem


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
5 years 7 months ago #76656 by MatGod
I'm using the option "use timezones" in the field setting. My Timezone is UTC -3.

In the database, the value is always saved in UTC 0 (I think), so it should have a line in php where they convert the UTC -3 to UTC 0. If this is the case, that could explain why the date is negative.

Also, this could mean the code is trying de subtract 3h from an impossible date and return something unexpected.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.895 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline