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 摘要。