Skip to content

Query returns old data #5700

Description

@aerni

Bug description

I ran into a stache issue with the query builder on a multi-site.

I've got two sites; default and german. The title of the origin is Home. The field is localizable and synced. The following query will return both the default and german entries.

Entry::query()->where('title', 'Home')->get();

If I now change the title on the origin to Home again, I would expect the query to return nothing. However, it will still return the german entry. Because the title of the entry in the stache is still Home. You have to either clear the stache or save the entry in the CP to flush it.

How to reproduce

  • Create a multi-site
  • Make the title localizable
  • Create a new entry and localization of it
  • Make sure the title is synced
  • Perform a simple query -> both entries are returned
  • Change the title on the origin
  • The query still returns the localized entry

Logs

No response

Versions

Statamic 3.3.3 Pro
Laravel 9.5.1
PHP 8.0.14

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

No response

Additional details

No response

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