Skip to content

Can't add Replicator sets after update to Statamic 6 #809

@helloiamlukas

Description

@helloiamlukas

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

  1. Fresh Statamic 6 + Runway 9 install with the Eloquent driver (Postgres)
  2. Create any Runway resource with a UUID PK and a Replicator on its blueprint.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions