Page 1 of 1

PostPosted: Thu Apr 05, 2007 2:25 pm
by rbchen
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

PostPosted: Fri Apr 06, 2007 9:21 am
by shannah

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


PostPosted: Sun Apr 08, 2007 2:11 am
by rbchen
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

PostPosted: Sun Apr 08, 2007 10:30 pm
by shannah

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


PostPosted: Mon Apr 09, 2007 12:26 am
by rbchen
Steve:

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

Thanks,
Raymond