You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I would like to say that your work is awesome!
Second, I am having troubles whit enum fields, The program (untouched) return:
{"success":false,"message":"Please check the form for errors","errors":{"jobStatus":"JobStatus:open exceeds the maximum length of openclosedpendingstalled","postedBy":"PostedBy:admin exceeds the maximum length of tenantadminowner","propertyMultiUnitsId":"PropertyMultiUnitsId is not a valid number","priority":"Priority:urgent exceeds the maximum length of urgenthighmediumlow"}}
And if I look into de the code I see this:
//Generated code
$fm["JobStatus"] = new FieldMap("JobStatus","REPM_jobs","job_status",false,FM_TYPE_ENUM,'open'.'closed'.'pending'.'stalled',"open",false);
Ah I see what is happening. In the meantime until I can get that fixed properly, you could fix your generated app by replacing
'open'.'closed'.'pending'.'stalled'
with a max-size number for the column.
I think what really should happen for enum columns is that Phreeze should generate a drop-down for that field with the appropriate values and then perhaps on the back-end validate them as well.
ok enum types are now supported and generated correctly in commit a4b2fc6. If you update Phreeze and regenerate the files in your libs/Model/DAO/ folder then you should get proper validation. I didn't update the generator to provide a drop-down yet, but i'll get to that.
First, I would like to say that your work is awesome!
Second, I am having troubles whit enum fields, The program (untouched) return:
{"success":false,"message":"Please check the form for errors","errors":{"jobStatus":"JobStatus:open exceeds the maximum length of openclosedpendingstalled","postedBy":"PostedBy:admin exceeds the maximum length of tenantadminowner","propertyMultiUnitsId":"PropertyMultiUnitsId is not a valid number","priority":"Priority:urgent exceeds the maximum length of urgenthighmediumlow"}}
And if I look into de the code I see this:
//Generated code
//FiledMap.php
2. public function __construct($pn, $tn, $cn, $pk = false, $ft = FM_TYPE_UNKNOWN, $fs = 0, $dv = null, $iai = null)
Phreezable.php
3. if ($fm->FieldSize && (strlen($this->$prop) > $fm->FieldSize))
{
$this->AddValidationError($prop,"$prop exceeds the maximum length of " . $fm->FieldSize . "");
}
So, I think you are sending a string where there should be a number, and there is not a base validation for the enum type field.
Thx
Cristian David.
The text was updated successfully, but these errors were encountered: