Can't filter by linked entries in multisite setup

未關閉
#3,528 14 則留言 0 個 reaction 已指派 2 人 在 GitHub 檢視

維護者通常 1 天內回覆

@jasonvarga 已經在處理了。

開始於 2025年3月18日。

評估

這個 Issue 還沒有評估資料。

描述

multisite stache

When using an entries field to filter the results in a collection tag, it does not work in a multisite setup.

Example:

A collection shows with an entries field called productions, where the user selects one entry from another collection called shows.

This tag works fine on the default locale, but it shows no results on all other locales.

{{ collection from="shows" :production:is="id" sort="show_date:asc" }}
  {{ if no_results }}
  no results
  {{ else }}
  {{ title }}
  {{/if }}
{{ /collection }}

It looks like the entries have different ids on all locales. The linked production is not translatable on all other locales, so it only has to be set once.

How to Reproduce

  1. Add collection productions
  2. Add collection shows with an entry field where you set max items to 1 and the collection to productions
  3. create a template with the collection tag from above
  4. create at least a second locale
  5. everything is working fine on the default locale, but not on all other locales

Extra Detail

This also applies when trying to do something like this: {{ 'ef2da943-c556-4a0f-9d71-73b37bfad38c' | get:url }} for hardcoded links in a template. This also only works on the default locale, because the entries have different ids. Question: why do the entries need different ids?

Environment

Statamic 3.1.6 Pro
Laravel 8.33.1
PHP 7.4.15
jonassiewertsen/statamic-livewire 2.5.0
spatie/statamic-responsive-images 2.5.3
statamic/seo-pro 2.1.5

Install method (choose one):

  • Fresh install from statamic/statamic
主要語言
PHP
星號
4.9k
分支
647
平均合併
1 天 45 分鐘
30 天內合併 PR
221

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

statamic/cms 的其他 Issue

查看 statamic/cms 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。