Incorrect Filtering Behavior in Multisite Setup for Related Entries with "Select Across Sites" Disabled

Aperta
#11,307 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
laravel, php
Ambito
backend

Direzione di ricerca

Reproduce the issue using the Authors and Articles collections in a multisite setup, with propagation enabled and Select Across Sites disabled on the Entries field. Start by tracing how the collection query applies the articles:exists="true" filter against the current site and how the Entries field setting affects related entries. Done means authors are excluded when their related articles exist only on another site; no relevant logs or test files are named in the issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

multisite
Bug Description

In a multisite setup, the "Entries" field does not respect the Select Across Sites setting. When Select Across Sites is disabled, related entries from other sites are still displayed incorrectly. Specifically, authors are shown with articles from other sites, even when those articles are not present on the current site. This causes the articles:exists="true" filter to return inaccurate results.

 {{ collection:authors paginate="60" articles:exists="true" as="authors" }}
        {{ partial:authors/list }}
 {{ /collection:authors }}
Screenshot 1:
Select Across Sites disabled
Screenshot 2:
Example of incorrect result
Steps to Reproduce
  1. Create an Authors collection (With Propagate true) and an Articles collection in a multisite setup.
  2. Add an "Entries" field to the Authors collection, linking it to the Articles collection. Ensure the "Select Across Sites" setting is disabled.
  3. Add an article to one site and relate it to an author. Ensure the same article does not exist on another site.
  4. View the authors entry on a site where the article should not be present.
    Result: The article is visible on the authors page, even if it shouldn't

Expected Behavior

Authors without articles on the current site should not be displayed when articles:exists="true" is used, especially when "Select Across Sites" is disabled.


Actual Behavior

Authors with articles on other sites are still displayed, ignoring the Select Across Sites restriction and the current site context.


Logs

No relevant logs available.


Environment
Environment
Application Name: OJC Web
Laravel Version: 11.35.1
PHP Version: 8.3.14
Composer Version: 2.8.3
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF
Timezone: UTC
Locale: de

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: sendmail
Queue: sync
Session: file

Statamic
Addons: 11
Sites: 4 (OJC (ojc.de), DIJG (dijg.de), Salzkorn (ojc-salzkorn.de), hOffen (hoffen-magazin.de))
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.42.1 PRO

Statamic Addons
aryehraber/statamic-logbook: 3.3.0
daun/statamic-placeholders: 3.0.1
eminos/statamic-iconify: 1.3.0
michaelmannucci/shades: 1.0.0
mitydigital/feedamic: 2.5.0
mitydigital/statamic-sticky-notes: 1.0.2
pecotamic/sitemap: 1.4.7
stillat/relationships: 2.2.1
swiftmade/statamic-clear-assets: 3.1.0
takepart-media/statamic-oreos: 1.3.0
webographen/statamic-admin-l

Installation

Fresh statamic/statamic site via CLI.


Additional Details

No additional context provided.

Lingua principale
PHP
Stelle
4.9k
Fork
647
Merge medio
1g 45m
PR unite (30g)
221

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di statamic/cms

Tutte le issue di statamic/cms

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.