Page 1 of 1

Bug: Date Field not saved

Posted: Wed Aug 19, 2020 3:38 pm
by kev1n
HI Steven,

There's a "nasty" bug here

Code: Select all

$idx = array_search($fields[$R], $CTSTN);
if($idx != false){  //-- valid field names
if a date field is the first element in the array $CTSTN, array_search(...) returns 0 and the condition if($idx != false) is not evaluated to true. As a consequence, the date value is not stored in the database.

We need to use the !== operator. Please change it to:

Code: Select all

if($idx !== false){  //-- valid field names
Explanation:
https://stackoverflow.com/a/15934417/10132321

Re: Bug: Date Field not saved

Posted: Fri Aug 21, 2020 3:10 am
by kev1n
I hope my description is clear?

Re: Bug: Date Field not saved

Posted: Sun Aug 23, 2020 12:48 am
by admin
kev1n,

I have applied your fix on Github.

Thaanks.


Steven

Re: Bug: Date Field not saved

Posted: Tue Aug 25, 2020 8:16 pm
by kev1n
Thanks!

Re: Bug: Date Field not saved

Posted: Fri Aug 28, 2020 11:40 pm
by admin
.