Skip to content

Only one field is visible when fieldsets contain different fields with same handle #11696

@thomas-wtfoxtrot

Description

@thomas-wtfoxtrot

Bug description

I was trying to set up a proof of concept for more complex fieldsets/components in Statamic, when I stumbled upon this.

To reduce redundancy I created fieldsets of common key/value pairs. In this case email+link label and phone number + link label.
Image
Image

But when I tried to use the fieldsets, there was only one of the labels visible instead of both.
Image

I found the issue rather quickly (changing the handle of one of them), but this is not intuitive in every scenario and every user.

How to reproduce

  1. Create a fieldset and call it "Email Link"
  2. Add a text field called "label" and a second one called "address"
  3. Save the settings
  4. Create a fieldset and call it "Phone Link"
  5. Add a text field called "label" and a second one called "number"
  6. Add the fieldsets to a blueprint
  7. Create a new page using the blueprint
  8. Scroll to the point where the fieldsets should render all fields
  9. Check if every field of the fieldset is visible

Environment

Environment
Application Name: Statamic
Laravel Version: 12.8.1
PHP Version: 8.4.6
Composer Version: 2.8.6
Environment: local
Debug Mode: ENABLED
URL: demo-demo.test
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

Storage
public/storage: NOT LINKED

Statamic
Addons: 0
Sites: 3 (Default, demo-1, demo-2)
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.53.0 PRO

Installation

Fresh statamic/statamic site via CLI

Additional details

Adding a prefix resolves the issue, but there is no indication in the UI that leads me to this solution.

It would be helpful either to be warned about this behavior, as soon as I create a field with an already existing handle or to receive a visual cue in the page editor, that explains the missing field.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions