Problem with setting the default Date value for fields withi

A place for users and developers of the Xataface to discuss and receive support.

Postby 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
rbchen
 
Posts: 21
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri Apr 06, 2007 9:21 am

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

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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
rbchen
 
Posts: 21
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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
rbchen
 
Posts: 21
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 39 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved