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

Dictionary fieldtype does not work as expected #10713

Closed
espenlg opened this issue Aug 28, 2024 · 0 comments · Fixed by #10719
Closed

Dictionary fieldtype does not work as expected #10713

espenlg opened this issue Aug 28, 2024 · 0 comments · Fixed by #10719

Comments

@espenlg
Copy link
Contributor

espenlg commented Aug 28, 2024

Bug description

I added a Dictionary fieldtype in a blueprint and used the example provided by php please make:dictionary to create custom content for the dropdown. The array for content to the dropdown looks like this:

["label" => $content["name"], "value" => $content["organization_number"], "url" => $content["url"]]

Now when I create an entry in the collection where this dictionary-fieldtype is in use things are getting weird. If empty/new then I can add all options once, and not able to select any duplicates. When I save and edit the same entry I can add them again which ends up in duplicates. When deleting every item with the same key/value is removed.

Here is a video of what happens:

Screen.Recording.2024-08-28.at.09.34.33.mp4

How is this supposed to work? I was hoping it would be in the same way as a taxonomy fieldtype.

How to reproduce

Not able to share repo as it is private, but I can provide more code examples if needed.

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 11.19.0
PHP Version: 8.2.20
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF
Timezone: UTC
Locale: en

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

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file

Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.23.0 PRO

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@espenlg @duncanmcclean and others