Tag condition not respecting default value

Abierto
#15,735 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
58/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
laravel, php
Área
backend

Línea de trabajo

Start by tracing how the collection tag applies field conditions and where blueprint defaults are made available to entries. Reproduce with an unsaved entry whose toggle defaults to true, then compare the condition result before and after saving it. Done when the tag returns entries matching the default value before they are explicitly saved.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Bug description

I have a bunch of entries and I added a toggle to their blueprint. The default value for the toggle is true.

I use the following code:

{{ collection:my_collection my_toggle:is="true" }}

And none of the entries show up, they have to be explicitly saved with the new blueprint.

How to reproduce
  1. Create entries for some collection.
  2. Add a toggle field to the blueprint with a default of true (or perhaps some other field).
  3. Fetch the entries based on the default value of the field using the collection tag.
  4. See none of the entries show up.
  5. Save entries.
  6. See the entries show up.
Logs

Environment
Environment
Laravel Version: 13.39.0
PHP Version: 8.5.12
Composer Version: 2.10.3
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: en

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

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

Storage
public/storage: NOT LINKED

Statamic
Addons: 7
License Key: Set
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.38.0 PRO

Statamic Addons
keyagency/statamic-asset-usage: 1.7.0
rias/statamic-color-swatches: 3.1.1
statamic-rad-pack/mailchimp: 6.2.5
statamic-rad-pack/shopify: 8.0.0
studio1902/statamic-peak-commands: 11.1.1
studio1902/statamic-peak-seo: 11.9.3
studio1902/statamic-peak-tools: 9.2.3
Installation

Starter Kit using via CLI

Additional details

No response

Lenguaje dominante
PHP
Estrellas
4.9k
Forks
647
Merge medio
21 h 3 min
PR fusionados (30 d)
128

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de statamic/cms

Todos los issues de statamic/cms

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.