Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`orWhere()`/`orWhereIn()` breaks Query Builder

オープン
#12,842 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
laravel, php

調査の方向性

Start by locating the Stache query builder methods used by whereIn() and orWhereIn(), then compare how they handle the reproduced query. Run a similar query against entries in the pages and events collections, including IDs from another collection. Done means the combined query returns the expected matching entries; the issue mentions suggested changes in a screenshot but names no files or tests.

索引モデルが issue の本文から書いたものです。

説明

stache
Bug description

I'm using the Stache for querying entries.

I try to query some entries from a set of collections, but I need to include some entries from another collection by ID.

This works perfectly fine:

Entry::query()
    ->whereIn('collection', ['pages', 'events'])
    ->get();

But adding ->orWhereIn('id', ['1234','456']) returns zero results:

Entry::query()
    ->whereIn('collection', ['pages', 'events'])
    ->orWhereIn('id', ['1234','456'])
    ->get();

According to Ryan, this could be solved by modifying lines 25 and 42, like in that screenshot below.

Image
How to reproduce

Run a similar query as written in the description.

Logs
nope
Environment
Environment
Application Name: Statamic
Laravel Version: 11.44.7
PHP Version: 8.4.13
Composer Version: 2.8.11
Environment: local
Debug Mode: ENABLED
URL: voicesforhealthykids.test
Maintenance Mode: OFF
Timezone: America/Chicago
Locale: en

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

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

Livewire
Livewire: v3.6.3

Statamic
Addons: 4
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.53.1 PRO

Statamic Addons
marcorieser/statamic-livewire: 4.4.3
rias/statamic-color-swatches: 2.3.0
statamic/seo-pro: 6.6.3
transformstudios/front: 3.0.2
Installation

Fresh statamic/statamic site via CLI

Additional details

No response

主要言語
PHP
スター
4.9k
フォーク
647
平均マージ
1日 8時間
マージ済み PR(30日)
100

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

statamic/cms のほかの issue

statamic/cms の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。