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
Validation fails or data is lost on save since 3.3 #5710
Comments
Here are the blueprints of the collection and some of the imported fields Collection Blueprinttitle: 'Angebot Prävention'
sections:
main:
display: Hauptteil
fields:
-
handle: title
field:
type: text
required: true
validate:
- required
localizable: true
-
import: page_header
-
import: page_heading
-
import: page_builder
seo:
display: SEO
fields:
-
import: seo
sidebar:
display: Sidebar
fields:
-
handle: meta
field:
display: Meta
type: section
icon: section
instructions: 'This entry''s meta data.'
listable: hidden
instructions_position: above
-
handle: slug
field:
type: slug
required: true
localizable: true
validate:
- required
-
handle: parent
field:
type: entries
collections:
- pages
max_items: 1
listable: false
localizable: true
page_header fieldsettitle: 'Page Header'
fields:
-
handle: page_hero
field:
mode: list
container: assets
restrict: false
allow_uploads: true
show_filename: true
max_files: 1
display: Bild
type: assets
icon: assets
listable: hidden
instructions_position: above page_heading fieldsettitle: 'Page Heading'
fields:
-
handle: main_heading
field:
input_type: text
antlers: false
display: Hauptüberschrift
type: text
icon: text
listable: hidden
instructions_position: above
validate:
- required
localizable: true
-
handle: small_heading
field:
default: false
display: 'Kleine Hauptüberschrift'
type: toggle
icon: toggle
instructions: 'Längere Überschriften sehen besser aus wenn sie etwas kleiner dargestellt werden.'
listable: hidden
instructions_position: above
-
handle: sub_heading
field:
input_type: text
antlers: false
display: Subline
type: text
icon: text
listable: hidden
instructions_position: above
localizable: true
-
handle: subline_script
field:
default: false
display: 'Subline im Handschrift-Stil'
type: toggle
icon: toggle
instructions: 'Der Handschrift-Stil eigenet sich nur für kurze Sublines'
listable: hidden
instructions_position: above
replicator_preview: false page_builder fieldsettitle: 'Page Builder'
fields:
-
handle: page_builder
field:
type: replicator
localizable: true
collapse: true
listable: false
display: 'Page builder'
instructions: 'Build your page by using various predefined content models.'
sets:
accordion:
display: Akkordeon
instructions: null
fields:
-
import: accordion
article:
display: Article
instructions: 'Long form content, can be expaned with media like figures, video, quotes or tables.'
fields:
-
import: article
list:
display: Aufzählungsliste
fields:
-
import: list
call_to_action:
display: 'Call to action'
instructions: 'Show a call to action.'
fields:
-
import: call_to_action
cards:
display: Cards
fields:
-
import: cards
collection:
display: Collection
instructions: 'Show collection entries.'
fields:
-
import: collection
events_in_category:
display: 'Veranstaltungen in Bereich'
instructions: null
fields:
-
import: events_in_category
events_on_current_page:
display: 'Veranstaltungen für aktuelle Seite'
instructions: null
fields:
-
import: events_on_current_page
features:
display: Features
fields:
-
import: features
form:
display: Form
instructions: 'Show a form.'
fields:
-
import: form
form_booking_individual:
display: 'Individuelles Buchungsformular'
instructions: null
fields:
-
import: form_booking_individual
gallery:
display: Galerie
fields:
-
import: gallery
hero:
display: Hero
fields:
-
import: hero
service_scope:
display: Leistungsumfang
instructions: 'Global definierten Leistungsumfang für HF oder BF einfügen'
fields:
-
import: service_scope
link_blocks:
display: 'Link blocks'
instructions: 'Show link blocks.'
fields:
-
import: link_blocks
service_scope_optional:
display: 'Optionaler Leistungsumfang'
fields:
-
import: service_scope_table_optional
pillars:
display: '5 Säulen'
instructions: null
fields:
-
import: pillars
text_image:
display: 'Text & Bild'
fields:
-
import: text_image
instructions_position: above |
Thanks to @ryanmitchell's suggesion I changed the handle of the field with the validation errors and all of a sudden the issue was gone 🥳 Looking further I saw that I've been using the handle |
Interesting, thanks for all the details. We'll look into this. |
Cool 👍 Let me know if I can provide any further information. |
Can you upgrade? This might have been fixed by #5805 which is in 3.3.7 |
I've removed all my instances of redundant field names since having the issue, so unfortunately I can't reproduce it anymore. |
Bug description
I have this odd behavior that prevents me from upgrading a project to 3.3
Here's a short screen recording where I show the issue:
https://www.loom.com/share/39bd37df53ef4c14b7f30b55468d28d1
A text field with a required validation throws a validation error:
When I remove the required validation from said field I can save the page, however the field is now emptied upon saving. This kinda explains why the validation fails: it seems the field is being pruned before validation happens.
Of course this makes me nervous for multiple reasons
How to reproduce
Unfortunately I'm having a hard time making this reproduceable.
Logs
No response
Versions
Statamic 3.3.4 Pro
Laravel 9.6.0
PHP 8.0.16
doublethreedigital/duplicator 2.1.1
goldnead/statamic-toc 1.1.0
Installation
Starter Kit using via CLI
Antlers Parser
regex (default)
Additional details
vue.common.prod
(log), but those where there with Statamic 3.2, tooThe text was updated successfully, but these errors were encountered: