Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace will not overwrite or clear a field value #1560

Open
brimby opened this issue Dec 5, 2024 · 0 comments
Open

Whitespace will not overwrite or clear a field value #1560

brimby opened this issue Dec 5, 2024 · 0 comments
Labels

Comments

@brimby
Copy link

brimby commented Dec 5, 2024

Description

If the source feed includes a value of a single space " ", the plain text field value will remain unchanged after processing the feed, irrespective of whether Set Empty Values is off or on. It seems to me that the single space should either be considered "a value" and replace the field value with " ", OR it should be considered "not a value" and in the case of Set Empty Values being ON, should clear the value of the field. But neither of these things appear to happen.

I haven't dug into the code, but my best guess is that the " " comes up false on an empty() check early on in the code, and thus doesn't qualify for the Set Empty Values special case, but perhaps later on down the line gets trim() applied and then fails an empty() check at that point (which maybe existed before the Set Empty Values functionality was added) and gets tossed out.

Edit: I was specifically using JSON to create ENTRIES

Additional info

  • Craft version: 4.13.5
  • PHP version: 8.2.0
  • Database driver & version: MySQL 5.7.39
  • Plugins & versions: Feed Me 5.9.0
@brimby brimby added the bug label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant