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

Tag synonym already exists error, when removing and re-adding with different capitalisation #1436

Open
Wouter17 opened this issue Oct 19, 2024 · 4 comments
Labels
area: ruby Changes to server-side code complexity: easy Issues that should take limited effort to resolve/fix/build. hacktoberfest This repo participates in Hacktoberfest. For suitable issues and Hacktoberfest-PRs meta: good first issue Good for newcomers meta: help wanted Extra attention is needed priority: medium type: bug Something isn't working

Comments

@Wouter17
Copy link

Describe the bug
When removing a tag synonym, and re-adding it in the same action (so without hitting save), but with different capitalisation, it will give a "There were some errors while saving this tag: Tag synonyms A tag synonym with the name X already exists." (where the new tag name replaces X). It will also show both versions as being synonyms.

To Reproduce
Steps to reproduce the behavior:

  1. Create a tag
  2. Add a synonym
  3. Remove the synonym (do not hit save)
  4. Add a version of the synonym with different capitalisation
  5. Press "Save"

Expected behavior
The new capitalisation version is saved correctly.

Screenshots
After removing the old one (AD) and adding the new one (ad) and pressing "save":

Error on tag edit page as described in "Describe the bug"

@ArtOfCode- ArtOfCode- added area: ruby Changes to server-side code meta: good first issue Good for newcomers meta: help wanted Extra attention is needed type: bug Something isn't working priority: medium hacktoberfest This repo participates in Hacktoberfest. For suitable issues and Hacktoberfest-PRs complexity: easy Issues that should take limited effort to resolve/fix/build. labels Oct 20, 2024
@ArtOfCode-
Copy link
Member

Looks like this is expected behaviour. Tags with different capitalizations are considered the same tag, so it makes sense that synonyms would behave the same.

What's behind this issue? Has there been a case of a synonym not applying because someone created a tag with a different capitalization than the synonym used?

@trichoplax
Copy link
Contributor

My impression from the issue description is that this is a problem with renaming a synonym during editing a tag itself, rather than changing the tags during editing a specific post.

I can reproduce the error. Here are my slightly more specific steps:

  1. Edit a tag to add a synonym.
  2. Save.
  3. Edit the same tag to remove the synonym (by pressing the "X" but not saving) and add a new synonym which has a different mix of upper and lower case.
  4. Save.
  5. See error.

Having a tag synonym with different case than you would like does not prevent it from functioning correctly. It will work regardless of what case a user saving a post enters. However, the system does already allow changing the case of a synonym, it just requires an additional save to make it work. For this reason it seems reasonable to improve the system, to allow making the change in a single step without saving in between.

The workaround in the meantime is as follows:

  1. Edit the tag to remove the synonym that you don't like the case of.
  2. Save.
  3. Edit the tag again to add the synonym with the case that you prefer.
  4. Save.

I believe that the intention of this issue is to avoid this need to save twice.

@trichoplax
Copy link
Contributor

Although changing the case of a synonym is never necessary in order to make it work correctly, it seems reasonable to be able to change it for clarity or to fix typos that only affect case.

For example, if I edit the tag feature-request to make a synonym chANge-request, then anyone adding the tag change-request to a post will see it replaced with feature-request, so this works correctly. However, the case listed in the tag, with accidental upper case in the middle of chANge-request, could make someone wonder whether there is some reason for it. It would therefore be useful to be able to edit the tag synonym to instead say change-request (with no upper case), even though this is not essential in order for it to work correctly.

@trichoplax
Copy link
Contributor

It's also possible that the error could give the impression that editing the case of a synonym is not possible, because the workaround by saving twice is not obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ruby Changes to server-side code complexity: easy Issues that should take limited effort to resolve/fix/build. hacktoberfest This repo participates in Hacktoberfest. For suitable issues and Hacktoberfest-PRs meta: good first issue Good for newcomers meta: help wanted Extra attention is needed priority: medium type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants