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

you can't delete a field's value #20

Closed
mrjones-plip opened this issue Nov 15, 2019 · 0 comments
Closed

you can't delete a field's value #20

mrjones-plip opened this issue Nov 15, 2019 · 0 comments
Assignees
Labels

Comments

@mrjones-plip
Copy link
Contributor

If you have entered a value in a field and saved it to the database, you can not save a null value back to that field.

steps to reproduce

  1. create a row in a databse
  2. go back and edit it and try to put no value (delete all text) and click save

expected - when you view the row, the field is empty
actual - the old value is still in the field

fix - in cleanseValuesAgainstSchema() we're checking if a field is defined like this:

if (isset($values[$key])) {

If $values[$key] == null then this isset will be false. we actually just want to see if it's defined, not if it's null. so let's switch that line to this:

if (array_key_exists($key, $values)) {

and we'll be all bettah!

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