statamic / cms

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

Multisite: Syncing Empty Bard Fields with Origin Site #10094

Open hairylemon-developers opened 1 month ago

hairylemon-developers commented 1 month ago

Bug description

There is an issue with syncing multisite entires with the origin site when the origin entry contain empty Bard fields in Statamic v5 (v4 is not affected).

The sync button will temporarily sync and then unsync again immediately with the button changing states for a second before flicking back to the unsynced state - have confirmed in the content folder that the entries are not synced after saving.

How to reproduce

  1. Install Statamic from CLI
  2. Upgrade to Statamic v5 (composer.json version change and composer update)
  3. Create a multisite (php please multisite)
  4. Disable automatic propagation under the Pages collection configuration
  5. Create a Blueprint with a Bard field that is localisable
  6. Create a page in the origin site with the new Blueprint
  7. Leave the Bard field blank and save the entry
  8. Click on the non-origin site to duplicate the entry to that site
  9. The entry will unsync automatically, clicking the sync button for the Bard field will not work
  10. Saving the entry will save it as unsynced from origin

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 10.48.10
PHP Version: 8.1.20
Composer Version: 2.3.7
Environment: local
Debug Mode: ENABLED
URL: localhost
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: sync
Session: file

Statamic
Addons: 0
Sites: 2 (Statamic, au)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.2.0 PRO

Installation

Fresh statamic/statamic site via CLI

Additional details

Found this with a v5 Statamic site which is more complex but confirmed with a fresh install as well.

ebeauchamps commented 1 month ago

FWIW, and certainly unrelated, you should use php > 8.2.0 with statamic 5.x