File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,14 @@ public function parseField(): mixed
6565 $ value = $ this ->field ->normalizeValue ($ value );
6666 }
6767
68- // if we're setting empty values and the value is an empty string - return it
68+ // if we're setting empty values and the value is empty - return an empty string
6969 // otherwise HtmlField will serialize it to null, and we setEmptyValues won't take effect
7070 // https://github.com/craftcms/feed-me/issues/1321
71- if ($ this ->feed ['setEmptyValues ' ] === 1 && $ value === '' ) {
72- return $ value ;
71+ // if the normalizeValue above returns null, which can happen for e.g. plain text field and a value of a single space
72+ // we also need to ensure that an empty string is returned, not the value as that can be null after normalization
73+ // https://github.com/craftcms/feed-me/issues/1560
74+ if ($ this ->feed ['setEmptyValues ' ] === 1 && empty ($ value )) {
75+ return '' ;
7376 }
7477
7578 // Lastly, get each field to prepare values how they should
You can’t perform that action at this time.
0 commit comments