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

Store NULL for empty descriptions and comments in the groups database tables #1442

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Jun 5, 2020

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide, as well as this entire template.
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes, and have included unit tests where possible.
  • I am willing to help maintain this change if there are issues with it later.
  • I give this submission freely and claim no ownership.
  • It is compatible with the EUPL 1.2 license
  • I have squashed any insignificant commits. (git rebase)

What does this PR aim to accomplish?:

Empty comments and descriptions should be stored as NULL in the database.

How does this PR accomplish the above?:

Check if the input fields are empty and, if so, store NULL. Storing NULL through bindValue() with SQLITE3_TEXT is explicitly supported and what we're doing already when editing. The code has just been missing for newly added entries.

You can check whether adding a new group with NULL descriptions worked using, e.g.,

sqlite3 /etc/pihole/gravity.db "SELECT * FROM \"group\" WHERE description IS NULL;"

What documentation changes (if any) are needed to support this PR?:

None

@DL6ER DL6ER added this to the v5.1 milestone Jun 5, 2020
@DL6ER DL6ER requested a review from PromoFaux June 5, 2020 10:01
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/add-group-overview-to-group-management/31323/16

@PromoFaux PromoFaux merged commit efd9281 into devel Jun 5, 2020
@PromoFaux PromoFaux deleted the fix/null_comments_in_groups branch June 5, 2020 18:17
@PromoFaux PromoFaux mentioned this pull request Jul 5, 2020
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-5-1-released/35577/1

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