Closed TomDo1234 closed 1 year ago
Could you have a look @dkirchhof?
Could you have a look @dkirchhof?
I hope when the bug gets fixed... Whether because of my commit or not, there is a hotfix released as a patch release
Hey @TomDo1234,
thanks for your PR. I think we have to handle both cases, right? If it is required, we need an empty array as fallback, if it isn't, we can just return undefined.
if (field.required && !blockValues) {
return [];
}
if (!field.required && !blockValues) {
return undefined;
}
Would you like to test it and update your PR?
Hey @TomDo1234,
thanks for your PR. I think we have to handle both cases, right? If it is required, we need an empty array as fallback, if it isn't, we can just return undefined.
if (field.required && !blockValues) { return []; } if (!field.required && !blockValues) { return undefined; }
Would you like to test it and update your PR?
I have made the changes, can YOU or @jpeiniger test this and then merge? I dont know how to test this
Thanks again. Just released the patched version on npm :)
Return an empty array when the field is NOT REQUIRED. blockValues can be null (Literally not set) when it is not required so you should check if it is NOT required.
Otherwise... You will get this bug in production when the collection has a NON REQUIRED blocks field, but no blocks.