You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the use of PHP empty(), the Feed Option setEmptyValues, when inactive, considers the the following values as empty:
(bool) false
(int) 0
(float) 0.0
I think the expected behavior for this feature is to only consider a value to be empty for empty strings and null. (If this assumption is wrong, we could at least add a note that empty values are checked with PHP's emtpy() method)
This is problematic for:
Lightswitch Fields that cannot be updated from true to false
Number Fields that cannot be updated to 0 or 0.0
Here is where the check is made in the Process class:
Description
Due to the use of PHP empty(), the Feed Option
setEmptyValues
, when inactive, considers the the following values as empty:I think the expected behavior for this feature is to only consider a value to be empty for empty strings and null. (If this assumption is wrong, we could at least add a note that empty values are checked with PHP's emtpy() method)
This is problematic for:
Lightswitch
Fields that cannot be updated fromtrue
tofalse
Number
Fields that cannot be updated to0
or0.0
Here is where the check is made in the
Process
class:https://github.com/craftcms/feed-me/blob/b0c9c9e25bb021876b37e25556e157f57d417de1/src/services/Process.php#LL398C9-L408C10
I'll gladly make a PR when/if we agree on a solution.
Steps to reproduce
setEmptyValues = 0
craft\fields\Lightswitch
) fromtrue
tofalse
craft\feedme\services\Process
on line 403Additional info
The text was updated successfully, but these errors were encountered: