Skip to content
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

Replicator set uses same object for child entries #11619

Closed
faltjo opened this issue Mar 25, 2025 · 0 comments · Fixed by #11621
Closed

Replicator set uses same object for child entries #11619

faltjo opened this issue Mar 25, 2025 · 0 comments · Fixed by #11621

Comments

@faltjo
Copy link
Contributor

faltjo commented Mar 25, 2025

Bug description

When using a replicator set to replicate items using a complex data type (objects, e.g. address field), the child items are not created correctly.

Basically a shallow copy of the default value(s) is used. This does not matter for simple data types. In case a complex data type is involved, the same object is used in multiple replications, thus overwriting and data-loss may occur before the entry is saved for the first time.

How to reproduce

  1. Clone https://github.com/faltjo/replicator-set-bug
  2. Create a user and open the CP
  3. Create a new entry in the collection 'Collection'
  4. Add two (or more) sets in the replicator (by clicking the '+' sign multiple times. Do NOT save the entry yet.
  5. Change the address in one of the replicator's items.
  6. The changes are also reflected to all of other replicated items, which should be independent of the changed one (the one chosen in step 5).

In the screenshot the first item was changed actively and the changes got reflected to the second one, which should be independent from the first.

Image

Logs

Environment

Environment
Application Name: Statamic
Laravel Version: 12.3.0
PHP Version: 8.3.19
Composer Version: 2.8.6
Environment: local
Debug Mode: ENABLED
URL: replicator-set-bug.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

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

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

Storage
public/storage: NOT LINKED

Statamic
Addons: 1
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.51.0 Solo

Statamic Addons
rias/statamic-address-field: 1.4.0

Installation

Starter Kit using via CLI

Additional details

The address-field addon is used (https://statamic.com/addons/rias/address-field).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants