Skip to content

Incorrect taxonomy term linked to multi-site collections in REST API #11342

@andrazperson

Description

@andrazperson

Bug description

When fetching all collection entries using GET /api/collections/{collection}/entries, the taxonomy term is not correctly localized. Works normally when fetching a specific collection entry GET /api/collections/{collection}/entries/{id}.
The correct taxonomy term in the screenshot is the right-side one (slug: "test-si")

image

This happens when the taxonomy term has UI Mode set to Stack Selector in the collection blueprint:
image

How to reproduce

Here is the GitHub repo with the bug: https://github.com/andrazperson/statamic-taxonomy-localization-bug

Login credentials are:

To reproduce:

  • link the taxonomy Categories to the Article blueprint and select it when creating a new entry in the Articles collection
  • publish the entry on both Statamic EN and Statamic SI sites
  • in the collection entries API response both entries should have a "Statamic EN" taxonomy term linked (incorrect), instead of EN taxonomy to EN site and SI taxonomy to SI site (correct)

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 11.37.0
PHP Version: 8.3.11
Composer Version: 2.7.9
Environment: local
Debug Mode: ENABLED
URL: statamic-taxonomy-localization-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

Statamic
Addons: 0
Sites: 2 (Statamic EN, Statamic SI)
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.45.1 PRO

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions