`orWhere()`/`orWhereIn()` breaks Query Builder
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- backend-api-design
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
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
- Lenguaje dominante
- PHP
- Estrellas
- 4.9k
- Forks
- 647
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 100
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de statamic/cms
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
There's a default crop when cropping imagesPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoassets
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Make native filesystem directory permissions configurable to support shared POSIX ACL accessAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
accessibility
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
antlers
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
Todos los issues de statamic/cms
Issues similares
-
needs-triage Platform(Default)
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
[Store] RstLoader detects headings inside indented code blocksPosiblemente ocupada @lazerg la tomó hoy. AbiertoBug Status: Needs Review Store
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug repo:ckeditor
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
No Code Attached Yet
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
joomla/joomla-cms#48611 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día