Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Bug: Date Field not saved

Questions related to using nuBuilder Forte.
Post Reply
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Bug: Date Field not saved

Unread post 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
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Bug: Date Field not saved

Unread post by kev1n »

I hope my description is clear?
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Bug: Date Field not saved

Unread post by admin »

kev1n,

I have applied your fix on Github.

Thaanks.


Steven
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Bug: Date Field not saved

Unread post by kev1n »

Thanks!
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Bug: Date Field not saved

Unread post by admin »

.
Post Reply