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

APIv4 - Correctly return null values from DAO save actions #16645

Merged
merged 1 commit into from
Feb 28, 2020

Conversation

colemanw
Copy link
Member

Overview

Make sure the value "null" is not returned as a string
Don't return null values from saved DAO objects unless it is in params or reload is set to true

Before

Some weirdness was coming back from APIv4 Create/Update/Save actions. null values were sometimes the string "null" (which is a workaround at the DB layer we don't want bleeding into the api).
It would also return some misleading data during update operations, returning null for fields which may not be null in the db but were not set in the update.

After

Ensures null is not returned as a string.
Ensures unknown values are not returned at all from update ops instead of being returned as null.

Technical Details

Test added.

Make sure the value "null" is not returned as a string
Don't return null values from saved DAO objects unless it is in params or reload is set to true
@civibot
Copy link

civibot bot commented Feb 28, 2020

(Standard links)

@civibot civibot bot added the master label Feb 28, 2020
@seamuslee001
Copy link
Contributor

Test fail is unrelated. Changes look fine to me

@artfulrobot
Copy link
Contributor

  • General standards
    • Explain PASS
    • User impact (r-user) PASS: This will be better for future users. Users who have put in place workarounds for the quirks before this PR won't be affected; they'll get the correct NULL already.
    • Documentation PASS: The changes do not require documentation because the result of the PR is that it works as documented :-)
    • Run it (r-run) UNREVIEWED
  • Developer standards
    • Technical impact (r-tech)
      PASS: The change preserves compatibility with existing callers/code/downstream.
    • Code quality (r-code)
      • PASS
    • Maintainability (r-maint)
      • PASS: Great to have the test in place.
    • Test results (r-test)
      • PASS: The test results have failures, but these have been individually inspected and found to be irrelevant.

@colemanw colemanw merged commit 03cfc3c into civicrm:master Feb 28, 2020
@colemanw colemanw deleted the null branch February 28, 2020 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants