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

Term creation through fieldtype doesn't respect locale for slug #7200

Closed
FrittenKeeZ opened this issue Dec 12, 2022 · 5 comments · Fixed by #7208
Closed

Term creation through fieldtype doesn't respect locale for slug #7200

FrittenKeeZ opened this issue Dec 12, 2022 · 5 comments · Fixed by #7208

Comments

@FrittenKeeZ
Copy link
Contributor

Bug description

Creating a term normally through its taxonomy page will generate the correct slug, however creating the term through the fieldtype will result in the slug being generated with English.

The term Kødpålæg in Danish should generate the slug koedpaalaeg, but in English it's generated as kodpalaeg.

How to reproduce

  1. Create a site with Danish locale da_DK
  2. Create a tags taxonomy
  3. Create the term Kødpålæg in Danish and verify the slug is as stated above
  4. Delete the term again
  5. Create an entry with the taxonomy associated in Danish
  6. Add Kødpålæg in the terms field without it existing
  7. Save the entry and go to the tags taxonomy
  8. Verify that the slug is wrongly generated as kodpalaeg

Logs

No response

Environment

Environment
Application Name: Comwell
Laravel Version: 9.42.2
PHP Version: 8.0.19
Composer Version: 2.1.5
Environment: local
Debug Mode: ENABLED
URL: comwell-v2.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: redis
Database: mysql
Logs: daily
Mail: mailgun
Queue: sync
Session: redis

Statamic
Addons: 3
Antlers: runtime
Version: 3.3.60 PRO

Statamic Addons
jacksleight/statamic-bard-mutator: 1.1.2
pecotamic/sitemap: 1.4.0
statamic/eloquent-driver: 1.1.1

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

None

Additional details

No response

@jasonvarga
Copy link
Member

Yeah, terms exist in the default site. If you enter a translation, it can't know what you wanted for the default language. Probably something for statamic/ideas#839.

You can work around this by adding create: false to the terms field on the entry. That way, users will be forced to create the terms before selecting them.

@FrittenKeeZ
Copy link
Contributor Author

@jasonvarga We have Danish as the origin / default site, so it's not trying to create a translation

@jasonvarga
Copy link
Member

Okay well maybe I misunderstood, but still, the workaround would be to prevent creating them on the fly there.

@FrittenKeeZ
Copy link
Contributor Author

@jasonvarga I just fixed the bug I was talking about - no need for a workaround

@jasonvarga
Copy link
Member

Oh I see what you mean. Gotcha.

jasonvarga pushed a commit that referenced this issue Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants