statamic / cms

The core Laravel CMS Composer package
https://statamic.com
Other
4.07k stars 532 forks source link

Validation error when field handle starts with a number #10652

Closed mscruse closed 2 months ago

mscruse commented 2 months ago

Bug description

When adding a field to a form blueprint and setting the handle to start with a number fails validation.

Real world scenario - Salesforce field that needs to have a handle of 00N5g000003ufGi

This is related to issue #10591

How to reproduce

Add field to form blueprint and have a handle that starts with a number.

Logs

No response

Environment

Environment
Application Name: 
Laravel Version: 11.20.0
PHP Version: 8.3.10
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: 
Maintenance Mode: OFF
Timezone: Australia/Melbourne
Locale: en

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

Drivers
Broadcasting: null
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 10
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.22.0 PRO

Statamic Addons
aryehraber/statamic-captcha: 1.12.1
jacksleight/statamic-bard-ipsum: 1.0.1
jacksleight/statamic-distill: 0.8.0
mitydigital/feedamic: 2.4.2
mitydigital/iconamic: 2.1.1
mitydigital/sitemapamic: 3.1.0
mitydigital/statamic-google-fonts: 2.0.0
mitydigital/statamic-scheduled-cache-invalidator: 2.0.5
mitydigital/statamic-sticky-not

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

jasonvarga commented 2 months ago

Why does the Statamic form field need to match the Salesforce required handle?

Can you show how you are sending this to Salesforce?

If it's something like an event handler, you could alias it like this...

$salesforce = [
  '00N5g000003ufGi' => $submission['salesforce_thing'],
];
mscruse commented 2 months ago

OK we'll look at another way.