Bug #80306
Editing profile does not work with 'date' fields
0%
Description
Hi,
in a form with one or more fields typed as 'date', editing profile does not work properly.
In the database, the fields as fe_users.date_of_birth are int(11), and the function SJBR\SrFeuserRegister\Domain\Data::parseIncomingData reads this fields to convert value from timestamp in a textual date.
The problem seems this: in editing profile, function "parseIncomingData" is called on row 151 of EditActionController:
$origArray = $this->data->parseIncomingData($origArray);
but around rows 79-82 of same file, the row:
$this->data->parseValues($dataArray, $origArray, $cmdKey);
fills $dataArray with $originArray, when $originArray is not already decoded for "date" fields.
Function SJBR\SrFeuserRegister\Domain\Data::parseValues around row 964, works only with a textual date (i.e. d-M-Y), and not with timestamp.
In this moment, my solution has been to move the row 151 in EditController, behind the row 79 in same file:
$origArray = $this->data->parseIncomingData($origArray); //here $dataArray['date_of_birth'] has been already transformed from timestamp to textual date...and parseValues works fine $this->data->parseValues($dataArray, $origArray, $cmdKey);
Thanks,
Gianluca
Related issues
History
#1
Updated by Gianluca Strafella over 2 years ago
- Subject changed from Profile editing does not works with date fields to Editing profile does not work with 'date' fields
#2
Updated by Stanislas Rolland almost 2 years ago
- Related to Bug #73532: Required field problem added
#3
Updated by Stanislas Rolland almost 2 years ago
- Status changed from New to Resolved
- Assignee set to Stanislas Rolland
This is fixed by the change that fixes #73532.