PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_Table » Bug #3018

Data overrides in getElement

Details

Request #3018Data overrides in getElement
Submitted2004-12-22 21:40 UTC
Fromdavid at glennweb dot net
Assignedpmjones
StatusClosed
PackageDB_Table
PHP Version4.3.3
OSwinxp
Roadmaps(Not assigned)

Comments

[2004-12-22 21:40 UTC] david at glennweb dot net

Description:
------------
Any user-set 'format' values for date and time types in getElement are -always- overwritten. Seems like the better idea would be to only set these if they aren't set already, allowing user-set values to pass through.

thx
~dave

Reproduce code:
---------------
Suggested changes:

date:

if (!isset($col['qf_opts']['format'])) {
$col['qf_opts']['format'] = 'Y-m-d';
}

time:

if (!isset($col['qf_opts']['format'])) {
$col['qf_opts']['format'] = 'H:i:s';
}

[2005-02-11 13:49 UTC] post at markwiesemann dot de

I'm not David but this has also been requested by me. To answer your question, Paul:

if (!isset($col['qf_opts']['format'])) {
$col['qf_opts']['format'] = 'Y-m-d';
}
would replace line 308 of current CVS version of QuickForm.php.

if (!isset($col['qf_opts']['format'])) {
$col['qf_opts']['format'] = 'H:i:s';
}
would replace line 326.

And as an addition to David's request:
if (!isset($col['qf_opts']['format'])) {
$col['qf_opts']['format'] = 'Y-m-d H:i:s';
}
would replace line 344.

Attention: The automatic casting of date/time values may not for other formats. The user who changes these format values has to take care of this and has to reformat the string returned from a QF form to DB_Table himself. This warning should be noted in the changelog if you accept the feature request.