Page 1 of 1

Read only field

Posted: 2013-12-07 23:49
by scorpio_x73
If i select "read only" in a calculated field the calculation is not done.

I mean that i i choose "read only" only to make the filed non editable from users but i cant get the calulation when its enable.

Is this normal behavior ?

Thank you again all.

Re: Read only field

Posted: 2014-01-02 19:25
by a.gneady
Yes ... currently a read-only field can't be set from the $data array in hooks. Please note that if you set it as editable, any value entered to it by users won't be applied anyway because the calculation would overwrite it. However, if you still want to set the field as read-only, you should perform the calculation in hooks using an SQL update query rather than modifying $data array.