`postDate` is not respected as cache TTL
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia dal percorso della richiesta di Element API per le query Entry utilizzando i criteri di stato live e pending, quindi traccia il modo in cui la cache delle risposte gestisce il postDate di un Entry. Riproduci lo scenario in sette passaggi con Craft 4.8.1 e conferma che l’API restituisca dati aggiornati di enabledForSite e status quando l’Entry diventa pubblico.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
When an Entry has a postDate in the future (pending) the \craft\base\Element::@$enabledForSite is disabled.
Once the postDate is in the past this (and other fields) becomes enabled, but the API will still return the old disabled value. Adding a random cache-busting query parameter to the API call will return the correct new state.
We use Craft as a headless CMS and want to be able to schedule articles in the future. However the cache isn't expired when the postDate is in the past.
Steps to reproduce
- Create an Entry that will be published in the future
- Request the Entry via the API with the criteria
statusset to[Entry::STATUS_LIVE, Entry::STATUS_PENDING] - Observe the
enabledForSitestate being false - Wait for the Entry to become public
- Refetch the data via the API
- The
enabledForSiteis still reported as false - Of course all other data is also stale; the status etc etc
Additional info
- Craft version: 4.8.1
- PHP version: 8.1
- Database driver & version: mysql 5.7
- Plugins & versions: Element API 3.0.1.1
- Lingua principale
- PHP
- Stelle
- 502
- Fork
- 55
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Issue simili
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
smarty-php/smarty#1215 ·
-
sync-en
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 4 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
ProfessionalWiki/NeoWiki#1637 ·
I maintainer di solito rispondono entro 1 giorno