cms icon indicating copy to clipboard operation
cms copied to clipboard

Non-localizable grid fields are saved into other sites

Open ali-awwad opened this issue 2 years ago • 1 comments

Bug description

I am experiencing unexpected behaviour, I have a non-localizable grid with two default fields. it works on the default "en" site as expected, but when switch to "ar" site, and click save, it also saves inside the Arabic .md file these two fields, even though they are greyed out readonly fields.

How to reproduce

  1. Make grid with two fields. Im my case, start time and end time.
  2. Make sure it is not localizable.
  3. Two sites, example.com/en , and example.com/ar
  4. Save on En site.
  5. go to Ar and save
  6. Check the .md file for AR, it will contain the fields values from the En (copy)
  7. Update the EN with different grid field values. In may case, change start time and end time
  8. Then go to AR, it will still show the old values because they are available on the AR .md file.

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 10.48.10
PHP Version: 8.3.7
Composer Version: 2.7.6
Environment: production
Debug Mode: OFF
Maintenance Mode: OFF

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

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: redis
Session: file

Statamic
Addons: 7
Sites: 2 (English, العربية)
Stache Watcher: Disabled
Static Caching: half
Version: 5.2.0 PRO

Statamic Addons
doefom/statamic-browser-detect: 0.1.1
mitydigital/sitemapamic: 3.0.2
ndx/statamic-bard-color-picker: 1.3.0
statamic/collaboration: 1.0.0
statamic/seo-pro: 6.0.2
stefangalescu/statamic-heroicons: 3.0

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

ali-awwad avatar May 21 '24 05:05 ali-awwad

The localization state is ignored for fields nested inside a grid. You can either localize the entire grid, or not.

https://github.com/statamic/ideas/issues/439

jasonvarga avatar May 21 '24 20:05 jasonvarga