6.0.0-beta6
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
3/24/26
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#14130] monthdayyear form element not saved in DB
*
Your Email Address
*
Spam protection
Enter the letters below:
. __ . ..__.. . | / `\ /| || | |___\__. \/ |__\|/\|
Comment
> I created a ticket type in whups that uses a custom field of type > monthdayyear but it wouldn't work, i.e. no matter what I entered the > values were not written into the backend. > > I tracked down the bug to the Form module of pear. In Form/Type.php > the monthdayyear object has a method called _validateAndFormat(). It > appears that the comparison in line 3021 of $this->_format_in with > null is using the wrong operator (===). I changed it to == and the > parameter gets saved to (and retrieved from) the database. > > Here is the method in question (fixed version): > > /** > * Validate/format a date submission. > */ > function _validateAndFormat($value, &$var) > { > /* If any component is empty consider it a bad date and return the > * default. */ > if ($this->emptyDateArray($value) == 1) { > return $var->getDefault(); > } else { > $date = $this->getDateOb($value); > if ($this->_format_in == null) { // line 3021, changed > comparison operator from === to == > return $date->timestamp(); > } else { > return $date->strftime($this->_format_in); > } > } > }
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers