Tag condition not respecting default value

Aperta
#15,735 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
laravel, php
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
PHP
Stelle
4.9k
Fork
647
Merge medio
21h 3m
PR unite (30g)
128

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di statamic/cms

Tutte le issue di statamic/cms

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.