Issue with readOnlyEditFields when one of the fields is required

Hi,

I noticed an issue with readOnlyEditFields. If you have a readOnlyEditFields set on a field and that field is also required, when you try to save the edit the required validation complains the field is not populated even though it is.

Thanks

Just to note this is on a setRelational field.

Anyone got any way around this?

Thanks

Hi,
I had the same problem migrating from orig GC to the new GC Ent

what I did, with the help of @johnny is this:

(readOnlyEditField → field3)

if($crud->getState()==‘EditForm’ || $crud->getState()==‘Update’){
$crud->requiredFields([‘field1’,‘field2’]);
}else{
$crud->requiredFields([‘field1’,‘field2’,‘field3’]);
}

1 Like

Brilliant thanks for the detail I will try this!

1 Like

Is there a enterprise bug tracker and somewhere I can submit bugs?

Unfortunately there isn’t. Currently the way that I am dealing with bug fixes is pick them up from forums/emails and add them to a huge private backlog that I have.

For example for this particular issue that you have unfortunately I can’t consider it as a bug because of the nature of Grocery CRUD Enterprise fields that can have only one field type per field. For example you “can’t” have both a field required and readOnly. The same thing happens (a very common issue) when you have a setRelation field and you would like to use it with callbackColumn (a callback field is still a different field type)

This is a big confusion for anyone but something to keep a note for the next major version of Grocery CRUD (e.g. version 3).

Ok noted,

If there is no list anywhere I will just continue to ask questions if I think maybe it is a bug.