Skip to content

Can't use title_format/title_field options with nested fields #703

@caseydwyer

Description

@caseydwyer

Description

Not sure what the right way of configuring a nested title_field (ie, from a JSON column) is supposed to be, but both approaches break in different locations—using a has_many in the examples below. Maybe a good thing to note in the docs, assuming only one of these is the right way? Here's what I'm seeing:

'title_field' => 'meta->name'

When using the arrow syntax...

  • Listings are broken (ie, title field shows, but is unlinked):
    Image
  • Relationships work (ie, links are present, to the record's edit form):
    Image

'title_field' => 'meta_name'

When using the underscore syntax...

  • Listings work (ie, links are present, to the record's edit form):
    Image
  • Relationships are broken (ie, records are missing a title altogether—in the edit form, and when shown as a listing column):
    Image

Steps to reproduce

  1. Add a meta column to a resource
  2. Add a has_many field to the blueprint of a parent resource
  3. Set a nested JSON field as the title_field in Runway config
  4. Switch between using -> or _ syntax for the title_field
  5. Note what breaks/works, as outlined above, after switching

Environment

Environment

Application Name: Statamic
Laravel Version: 12.20.0
PHP Version: 8.4.10
Composer Version: 2.8.8
Environment: local
Debug Mode: ENABLED
URL: samplesite.test
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: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Storage
A:\www\samplesite\public\storage: NOT LINKED

Livewire
Livewire: v3.6.3

Statamic
Addons: 7
Sites: 3 (Fraternity, Foundation, Housing)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.60.0 PRO

Statamic Addons
caseydwyer/statamic-long-range: dev-main
doefom/currency-fieldtype: 1.4.1
eminos/statamic-tabs: 1.2.0
jacksleight/statamic-miniset: 1.3.0
marcorieser/statamic-livewire: 4.5.2
statamic-rad-pack/runway: 8.5.2
statamic/seo-pro: 6.7.0

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions