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

Saving tags before post creates unused/unwanted tags #15406

Open
iandunn opened this issue May 3, 2019 · 7 comments
Open

Saving tags before post creates unused/unwanted tags #15406

iandunn opened this issue May 3, 2019 · 7 comments
Labels
[Feature] Inspector Controls The interface showing block settings and the controls available for each block Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended [Type] Enhancement A suggestion for improvement.

Comments

@iandunn
Copy link
Member

iandunn commented May 3, 2019

Describe the bug

New tags are saved in the database before the user has indicated that they should be.

To reproduce
Steps to reproduce the behavior:

  1. Add or edit a post
  2. Open the Tags control in the sidebar
  3. Type a tag with a typo, e.g., javascritp
  4. Press , to start typing the next tag
  5. Notice you made a typo and remove the previous tag
  6. Re-type the tag correctly, javascript, press enter
  7. Save draft
  8. Browse to Posts > Tags screen

There's be 2 new tags, javascript and javascritp.

Expected behavior

New tags should not be created until the user has manually triggered a save of the post (whether thats as a draft, or publishing).

@iandunn iandunn added [Type] Enhancement A suggestion for improvement. Needs Design Feedback Needs general design feedback. [Feature] Inspector Controls The interface showing block settings and the controls available for each block labels May 3, 2019
@mapk
Copy link
Contributor

mapk commented May 21, 2019

Thanks @iandunn! I've experienced this as well in addition to having tags completely vanish as I'm adding more tags to the post.

This seems to be a development bug and doesn't require any design feedback. I'll adjust the labels.

@mapk mapk added [Type] Bug An existing feature does not function as intended Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels May 21, 2019
@iandunn
Copy link
Member Author

iandunn commented May 21, 2019

Ah, I wasn't sure if saving tags before the post was intentional or not. 👍

@gwwar
Copy link
Contributor

gwwar commented Apr 1, 2021

Verified that we do create tags on , or enter

tag.mp4

@paaljoachim
Copy link
Contributor

@Mamaduka George is planning on working on improving the Tags feature in Gutenberg. Here is the issue for it. I linked to my comment. #8867 (comment)
It would be great for him to have this in mind as he creates the PR.
Thanks!

@paaljoachim
Copy link
Contributor

There is now a new PR by @Mamaduka George here: #30598

It also tackles the bug in this issue.

@annezazu
Copy link
Contributor

@paaljoachim you linked to a PR that's been merged but I'm still able to replicate this problem in 10.6.1 which should have the fix:

Screen.Recording.2021-05-17.at.9.44.41.PM.mov

Tagging you in case you have more insight here! If not, let's keep this open since it doesn't seem resolved.

@Mamaduka
Copy link
Member

Mamaduka commented Jun 3, 2021

Hi, @annezazu

Unfortunately, my PR didn't solve this issue. It is an enhancement for Tag settings.

The main problem here's is that we can't create terms when saving/creating posts via REST API. It means creating terms before a post is saving and providing IDs for the API call.

Like @iandunn suggested, we should defer tag creation until the user triggers save. I've some ideas on how to do this, but I'm not 100% sure about the best option.

I'm open to suggestions and happy to work on PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inspector Controls The interface showing block settings and the controls available for each block Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

6 participants