post by markab on Nov 7, 2021

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

post by markab on Nov 8, 2021

post by markab on Nov 12, 2021

post by Phil on Nov 16, 2021

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’]);
}

post by markab on Nov 16, 2021

Brilliant thanks for the detail I will try this!

post by markab on Nov 16, 2021

post by johnny on Nov 17, 2021

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).

post by markab on Nov 17, 2021

Ok noted,

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

2 years later

post by kapilchugh on Apr 24, 2024

@johnny - Perhaps there is no change with V3 as well.
At the time of add we need it as required field while on edit it should be readonly. Please suggest how to achieve it?

1 / 9
Nov 2021