Skip to content

Localized entries with inherited/synced fields return empty values in API responses #14844

@BobWez98

Description

@BobWez98

Bug description

When an entry has a localization, fields that are synced/inherited from the origin entry render correctly in the Statamic Control Panel. The localized entry shows the origin value when the field has not been changed locally.

However, when querying the localized entry through the API, those inherited field values are returned as empty strings instead of falling back to the origin entry’s values.

If I manually change the same fields on the localization, the values are stored on the localized entry and then appear correctly in the API response.

Expected behavior: API responses for localized entries should return the resolved field value, including inherited/synced values from the origin entry when no local override exists.

Actual behavior: API responses return empty values for fields that visually resolve correctly in the Control Panel.

Screenshots show:

  • Localized entry displaying inherited SEO values in the Control Panel
  • API response returning empty meta_title and meta_description
  • Localized entry after changing/saving the values
  • API response then returning the values correctly

Field is synced with origin:
(meta title and description)

Image

API response:

Image

Changed field values:

Image

API Response:

Image

How to reproduce

  1. Set up a Statamic site with multiple locales/sites enabled.
  2. Create a collection with fields that are available on localized entries, for example:
    • meta_title
    • meta_description
  3. Create an entry in the origin locale and fill in those fields.
  4. Create a localization of that entry.
  5. Do not change/override the synced fields on the localized entry.
  6. Open the localized entry in the Control Panel.
  7. Confirm that the fields visually show the inherited values from the origin entry.
  8. Query the localized entry through the API.
  9. Notice that the inherited fields are returned as empty strings
  10. Go back to the localized entry, change/save those same fields locally.
  11. Query the API again.
  12. The fields are now returned correctly in the API response.

Logs

Environment

Environment
Laravel Version: 13.7.0
PHP Version: 8.5.5
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: log
Cache: file
Database: mysql
Logs: stack / single
Mail: log
Queue: redis
Session: database

Storage
public/storage: NOT LINKED

Sentry
Enabled: MISSING DSN
Environment: local
Laravel SDK Version: 4.25.0
PHP SDK Version: 4.25.0
Release: NOT SET
Sample Rate Errors: 100%
Sample Rate Performance Monitoring: 100%
Sample Rate Profiling: NOT SET
Send Default PII: ENABLED

Statamic
Addons: 9
Sites: 12 (Trucks Nederland, Trucks België | Nederlands, Trucks International | English, and 9 more)
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.15.0 PRO

Statamic Addons
appswithlove/statamic-one-click-content-translation: 6.0.3
just-better/bard-link-suggestions: 0.0.1
just-better/translations-overview: dev-feature/statamic-6
just-better/url-reference-updater: dev-feature/statamic-6
justbetter/lost-in-translation: dev-feature/statamic-6
justbetter/statamic-entry-translator: 0.2.0
markkravchuk/statamic-activity-book: 1.0.1
statamic/eloquent-driver: 5.6.3
statamic/importer: 2.1.0

Statamic Eloquent Driver
Addon Settings: file
Asset Containers: file
Assets: eloquent
Blueprints: file
Collection Trees: eloquent
Collections: file
Entries: eloquent
Fieldsets: file
Form Submissions: file
Forms: file
Global Sets: file
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: file
Revisions: eloquent
Sites: file
Taxonomies: file
Terms: eloquent
Tokens: file

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions