Use case:
I have an optional reference field on my entity whose value is either undefined or an id of another entity
Expected:
admin-on-rest checks the value of the record with the given source prop, and if undefined displays nothing, otherwise a request for the referenced entity is sent and the reference child field is displayed
Actual:
admin-on-rest sends a GET_MANY request with parameter ids as ["undefined"]
Did you set the allowEmpty prop on <ReferenceField>?
Yes I have. It didn't make a difference, and I can tell by code inspection no checks are made for undefined values and no tests are written for that case
Confirmed, that's a bug
@fzaninotto can we do the same thing with ReferenceArrayField ? I can send a pr if you are okay with this.
Most helpful comment
Did you set the
allowEmptyprop on<ReferenceField>?