File tree Expand file tree Collapse file tree
packages/apostrophe/modules/@apostrophecms/doc-type/ui/apos/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -567,6 +567,7 @@ export default {
567567 }
568568
569569 if (field .type === ' select' || field .type === ' radio' ) {
570+ // WARNING: field choices might be a string (dynamic choices)
570571 const validChoices = field .choices .map (choice => choice .value );
571572
572573 if (! validChoices .includes (object[field .name ])) {
@@ -579,12 +580,13 @@ export default {
579580 }
580581
581582 if (field .type === ' checkboxes' ) {
583+ // WARNING: field choices might be a string (dynamic choices)
582584 const validChoices = field .choices .map (choice => choice .value );
583585
584586 const filteredValues = object[field .name ]
585- .filter (value => validChoices .includes (value));
587+ ? .filter (value => validChoices .includes (value));
586588
587- if (filteredValues .length ) {
589+ if (filteredValues? .length ) {
588590 object[field .name ] = filteredValues;
589591 continue ;
590592 }
You can’t perform that action at this time.
0 commit comments