cms icon indicating copy to clipboard operation
cms copied to clipboard

Possible bug in group fieldtype validation

Open gn-bmiddendorp opened this issue 6 months ago • 0 comments

Bug description

When trying to save my entry, an invalid missing field message is shown. I am using an entry containing a group "hero" with 2 field groups named: hero_card_left and hero_card_right. Which both hold call to action properties. In this case upon saving this group with 2 of the same value for link. The value is left empty when submitting the form and thus the required message is shown.

Using the same value 'test.nl' for Link Image

Portion of the request send to form handler. The first link value is set to null even though I set it to test.nl. Image

How to reproduce

  • Create an Entry
  • Add a field group
  • Add 2 groups (left or right) inside that group with the same keys
  • Use the same value for in this case 'Link'

Logs

Full request send to form handler:

{"title":"Home","hero":{"title":"WIJ ZIJN ER VOOR JOU","text":[{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Heb je vragen of wil je gewoon iets leuks doen? Bij JOU allerlei activiteiten. Doe je mee?"}]}],"image":[],"call_to_action_1":{"label":"Onze diensten","link":"/wat-wij-doen","icon":null},"call_to_action_2":{"label":"Neem contact op","link":"/contact","icon":null},"hero_card_left":{"title":"ANTWOORD OP JOU VRAGEN","text":[{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Heb je vragen of zit je ergens mee? Onze jongerenwerkers helpen je graag."}]}],"link":null,"image":[]},"hero_card_right":{"title":"EXPOSED?!","text":[{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Spannende berichten of foto's naar elkaar sturen kan ontzettende leuk en spannend zijn, maar wat als het mis gaat?"}]}],"link":"test.nl","image":[]}},"content":[],"internal_name":null,"slug":"home","parent":[],"seo":{"enabled":true,"title":{"source":"inherit","value":null},"description":{"source":"inherit","value":null},"site_name":{"source":"inherit","value":null},"site_name_position":{"source":"inherit","value":null},"site_name_separator":{"source":"inherit","value":null},"canonical_url":{"source":"inherit","value":null},"robots":{"source":"inherit","value":[]},"image":{"source":"inherit","value":null},"twitter_handle":{"source":"inherit","value":null},"sitemap":{"source":"inherit","value":null},"priority":{"source":"inherit","value":null},"change_frequency":{"source":"inherit","value":null}},"published":true,"id":"4700982b-5705-4ff1-a364-b19da7f0872c","_blueprint":"homepage_jou","_localized":["title","hero","updated_at"]}

Full entry blueprint:

title: 'Homepagina (JOU)'
tabs:
  main:
    display: Main
    sections:
      -
        fields:
          -
            handle: title
            field:
              type: text
              required: true
              localizable: true
              validate:
                - required
          -
            handle: hero
            field:
              type: group
              display: Hero
              localizable: true
              fields:
                -
                  handle: title
                  field:
                    type: text
                    display: Titel
                    localizable: true
                    validate:
                      - required
                -
                  handle: text
                  field:
                    save_html: true
                    remove_empty_nodes: false
                    type: bard
                    display: Text
                    localizable: true
                    validate:
                      - required
                -
                  handle: image
                  field:
                    max_files: 1
                    container: uploads
                    type: assets
                    display: Afbeelding
                    localizable: true
                -
                  handle: call_to_action_1
                  field: call_to_action_fieldset.call_to_action_optional
                  config:
                    display: 'Call to action 1'
                -
                  handle: call_to_action_2
                  field: call_to_action_fieldset.call_to_action_optional
                  config:
                    display: 'Call to action 2'
                -
                  handle: hero_card_left
                  field:
                    type: group
                    display: 'Hero card (links)'
                    localizable: true
                    fields:
                      -
                        handle: title
                        field:
                          type: text
                          display: Titel
                          localizable: true
                          validate:
                            - required
                      -
                        handle: text
                        field:
                          save_html: true
                          remove_empty_nodes: false
                          type: bard
                          display: Tekst
                          localizable: true
                          validate:
                            - required
                      -
                        handle: link
                        field:
                          type: link
                          display: Link
                          localizable: true
                          validate:
                            - required
                      -
                        handle: image
                        field:
                          max_files: 1
                          container: uploads
                          type: assets
                          display: Afbeelding
                          localizable: true
                -
                  handle: hero_card_right
                  field:
                    type: group
                    display: 'Hero card (rechts)'
                    localizable: true
                    fields:
                      -
                        handle: title
                        field:
                          type: text
                          display: Titel
                          localizable: true
                          validate:
                            - required
                      -
                        handle: text
                        field:
                          save_html: true
                          remove_empty_nodes: false
                          type: bard
                          display: Tekst
                          localizable: true
                          validate:
                            - required
                      -
                        handle: link
                        field:
                          type: link
                          display: Link
                          localizable: true
                          validate:
                            - required
                      -
                        handle: image
                        field:
                          max_files: 1
                          container: uploads
                          type: assets
                          display: Afbeelding
                          localizable: true
          -
            handle: content
            field:
              type: replicator
              display: Inhoud
              localizable: true
              sets:
                fieldsets:
                  display: Fieldsets
                  sets:
                    call_to_action_section:
                      display: 'Call to action sectie'
                      fields:
                        -
                          handle: call_to_action_section
                          field: sections.call_to_action_section
                    text_section:
                      display: 'Tekst sectie'
                      fields:
                        -
                          handle: text_section
                          field: sections.text_section
                    text_and_image_section:
                      display: 'Tekst en afbeelding sectie'
                      fields:
                        -
                          handle: text_and_image_section
                          field: sections.text_and_image_section
                    video_section:
                      display: 'Video sectie'
                      fields:
                        -
                          handle: video_section
                          field: sections.video_section
                    faq_section:
                      display: 'FAQ sectie'
                      fields:
                        -
                          handle: faq_section
                          field: sections.faq_section
                    location_section:
                      display: 'Locatie sectie'
                      fields:
                        -
                          handle: location_section
                          field: sections.location_section
                    slider_section:
                      display: 'Slider sectie'
                      fields:
                        -
                          handle: slider_section
                          field: slider_section.slider_section
          -
            handle: internal_name
            field: internal_name.internal_name
            config:
              localizable: true
              visibility: read_only
  sidebar:
    display: Sidebar
    sections:
      -
        fields:
          -
            handle: slug
            field:
              type: slug
              localizable: true
              validate: 'max:200'
          -
            handle: parent
            field:
              type: entries
              collections:
                - pages
              max_items: 1
              listable: false
              localizable: true
              query_scopes:
                - only_root_scope
              create: false
  SEO:
    display: SEO
    sections:
      -
        fields:
          -
            handle: seo
            field:
              type: seo_pro
              listable: false
              display: SEO
              localizable: true

Environment

Environment
Application Name: Stichting PK
Laravel Version: 12.20.0
PHP Version: 8.4.6
Composer Version: 2.8.8
Environment: dev
Debug Mode: ENABLED
URL: stichting-pk-backend.e-container.nl
Maintenance Mode: OFF
Timezone: UTC
Locale: nl

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

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

Storage
public/storage: NOT LINKED

Sentry
Enabled: MISSING DSN
Environment: dev
Laravel SDK Version: 4.15.1
PHP SDK Version: 4.14.2
Release: NOT SET
Sample Rate Errors: 100%
Sample Rate Performance Monitoring: NOT SET
Sample Rate Profiling: NOT SET
Send Default PII: DISABLED

Statamic
Addons: 3
Sites: 5 (Stichting PK, U Centraal, Jou Utrecht, Mantelzorg Utrecht, Geld en recht)
Stache Watcher: Disabled (auto)
Static Caching: Disabled
Version: 5.60.0 PRO

Statamic Addons
statamic-rad-pack/runway: 8.5.2
statamic/eloquent-driver: 4.29.1
statamic/seo-pro: 6.7.0

Statamic Eloquent Driver
Asset Containers: file
Assets: eloquent
Blueprints: file
Collection Trees: eloquent
Collections: file
Entries: eloquent
Forms: file
Global Sets: eloquent
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: file
Revisions: eloquent
Sites: file
Taxonomies: file
Terms: file
Tokens: eloquent

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

gn-bmiddendorp avatar Sep 29 '25 11:09 gn-bmiddendorp