Description
Issue
Since the update to Statamic 6 / Runway 9, I get an error when adding any set to a Replicator field:
SQLSTATE[22P02]: invalid input syntax for type uuid: "runway::{model}::{uuid}"
(SQL: select * from "entries" where "id" = runway::{model}::{uuid} )
Cause
Statamic 6 added ReplicatorSetController (statamic/cms#13427), which calls Data::find($request->reference) to resolve the parent of a lazy-loaded set. For Runway that reference is runway::{model}::{uuid}.
DataRepository::splitReference then splits this into runway and {model}::{uuid}. Runway registers the model repository under runway-resources and not runway, so DataRepository::find() calls attemptAllRepositories('find', $reference).
EntryRepository::find() in the Eloquent driver then calls ->where('id', 'runway::{model}::{uuid}')->first() which causes the DB error.
Steps to reproduce
- Fresh Statamic 6 + Runway 9 install with the Eloquent driver (Postgres)
- Create any Runway resource with a UUID PK and a Replicator on its blueprint.
- Edit a model in the CP and click Add Set on that field.
Environment
Environment
Laravel Version: 12.56.0
PHP Version: 8.3.22
Composer Version: 2.9.7
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: null
Cache: file
Database: pgsql
Logs: stack / single
Mail: log
Queue: sync
Session: file
Livewire
Livewire: v3.7.13
Statamic
Addons: 2
Sites: 1
Stache Watcher: Disabled
Static Caching: Disabled
Version: 6.13.0 PRO
Statamic Addons
statamic-rad-pack/runway: 9.4.3
statamic/eloquent-driver: 5.6.2
Description
Issue
Since the update to Statamic 6 / Runway 9, I get an error when adding any set to a Replicator field:
Cause
Statamic 6 added ReplicatorSetController (statamic/cms#13427), which calls
Data::find($request->reference)to resolve the parent of a lazy-loaded set. For Runway that reference isrunway::{model}::{uuid}.DataRepository::splitReferencethen splits this intorunwayand{model}::{uuid}. Runway registers the model repository underrunway-resourcesand notrunway, soDataRepository::find()callsattemptAllRepositories('find', $reference).EntryRepository::find()in the Eloquent driver then calls->where('id', 'runway::{model}::{uuid}')->first()which causes the DB error.Steps to reproduce
Environment
Environment
Laravel Version: 12.56.0
PHP Version: 8.3.22
Composer Version: 2.9.7
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: null
Cache: file
Database: pgsql
Logs: stack / single
Mail: log
Queue: sync
Session: file
Livewire
Livewire: v3.7.13
Statamic
Addons: 2
Sites: 1
Stache Watcher: Disabled
Static Caching: Disabled
Version: 6.13.0 PRO
Statamic Addons
statamic-rad-pack/runway: 9.4.3
statamic/eloquent-driver: 5.6.2