Problem with setting the default Date value for fields withi

Archived from the Xataface Users forum.

rbchen — Thu Apr 05, 2007 2:25 pm

I noticed that if I have 2 Date fields (A and B) that are grouped together in the fields.ini, only the later one will get its default value rendered in the “New Record” page.

If I take them out of the group, then both default value will get rendered.

Since I have tried to set the default value through different approach (fields.ini, %field%__display(), from DB default value), I am pretty sure it’s probably a bug in the group feature.

Is there a work around using the current latest release?

Thanks,
Raymond


shannah — Fri Apr 06, 2007 9:21 am

Interesting bug… not sure why it’s happening… but I’ll look into it.


rbchen — Sun Apr 08, 2007 2:11 am

Hi Steve:

Thanks for your reply. Is it possible to have this fixed in the next release? The “grouping” feature make the UI much nicer if the table have many fields but this bug have made it almost useless

Thanks,
Raymond


shannah — Sun Apr 08, 2007 10:30 pm

in Dataface/QuickForm.php

Search for the line with:

$defaults[$this->_fields[$key][‘group’]] = array($key=>$defaultValue);

and change it to:

$defaults[$this->_fields[$key][‘group’]][$key] = $defaultValue;

That should fix the problem.

-Steve


rbchen — Mon Apr 09, 2007 12:26 am

Steve:

I don’t know what to say… you’re BRILLIANT!!! Thanks again for the quick response!

Thanks,
Raymond