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

Editing a post body field will not save an empty string #2287

Closed
GitOffMyBack opened this issue May 30, 2022 · 3 comments
Closed

Editing a post body field will not save an empty string #2287

GitOffMyBack opened this issue May 30, 2022 · 3 comments
Labels
area: api bug Something isn't working

Comments

@GitOffMyBack
Copy link

Issue Summary

Make a post and enter some text into the body field. Then click the edit post button. Clear out all the text in the body field leaving it blank. Then click save. The cleared out text will reappear.

@GitOffMyBack GitOffMyBack added the bug Something isn't working label May 30, 2022
@dessalines
Copy link
Member

I've found the culprit here, its the PostForm's not correctly using Option<Option<.. on the optional SQL columns.

@Nutomic
Copy link
Member

Nutomic commented Jul 29, 2022

Is this fixed, or just closed by accident?

@dessalines
Copy link
Member

dessalines commented Jul 29, 2022

Its fixed by that commit.

dessalines added a commit that referenced this issue Jun 5, 2024
- To address difficulties with clearing URL-type fields like
  avatars, banners, site icons, this PR turns the URL type form
  fields into strings.
- This allows an empty string to be used as a "clear data", as
  in the case with the regular text form fields.
- Also includes various cleanups.
- Fixes #4777
- Context: #2287
dessalines added a commit that referenced this issue Jun 6, 2024
* Allow empty string to clear URL-type DB fields.

- To address difficulties with clearing URL-type fields like
  avatars, banners, site icons, this PR turns the URL type form
  fields into strings.
- This allows an empty string to be used as a "clear data", as
  in the case with the regular text form fields.
- Also includes various cleanups.
- Fixes #4777
- Context: #2287

* Fixing comment.

* Use Option<&str> and deref.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants