Use of {parent:} causes glitch in {parent}{/parent} loop tag
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Use the two template snippets in the issue as the entry point: both show {parents} loop output being corrupted after a single {parents:url_title} tag is used outside the loop. Reproduce against ExpressionEngine 7.5.25 with PHP 8.2 and trace how parent variables are parsed and counted in the channel entries template handler. Done means the single tag no longer alters loop counts, and each parent returns its own correct data.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description of the problem
With relationships, you can access parents with a loop, or you can access a single parent with direct tags.
But if you use both, you end up with unexpected data output errors (a bug).
How To Reproduce
Steps to reproduce the behavior:
- Create an entry with two or more parents in two different fields/channels
- Use one of the two examples below.
- See the wrong data
Screenshots / Videos / Template Code
TEMPLATE ONE - ONLY USING PARENTS LOOP:
{exp:channel:entries channel="chan-mag-articles" status="Open" limit="1" url_title="golden-goals" dynamic="no"}
{title}<br>
{parents field="mag_articles"}
{parents:url_title} - {parents:title} - {parents:mag_cover}<br>
{/parents}
Text here<br>
{parents}
{parents:count} - {parents:url_title} - {parents:title} - {parents:mag_cover}<br>
{/parents}
{/exp:channel:entries}
OUTPUT:
Golden Goals
fall-2024 - Fall 2024 - uploads/magazine/USC-Chan-Magazine-fall24.jpg
Text here
1 - courtney-shoda - Courtney Shoda Quote -
2 - fall-2024 - Fall 2024 - https://chan.usc.edu/uploads/magazine/USC-Chan-Magazine-fall24.jpg
NOTE: See how the second parent loop has correct data for each parent?
TEMPLATE TWO - USING PARENTS LOOP AND PARENTS SINGLE:
{exp:channel:entries channel="chan-mag-articles" status="Open" limit="1" url_title="golden-goals" dynamic="no"}
{title}<br>
{parents field="mag_articles"}
{parents:url_title} - {parents:title} - {parents:mag_cover}<br>
{/parents}
Text here: {parents:url_title} - {parents:title}<br>
{parents}
{parents:count} - {parents:url_title} - {parents:title} - {parents:mag_cover}<br>
{/parents}
{/exp:channel:entries}
OUTPUT:
Golden Goals
fall-2024 - Fall 2024 - https://chan.usc.edu/uploads/magazine/USC-Chan-Magazine-fall24.jpg
Text here: courtney-shoda - Courtney Shoda Quote
1 - courtney-shoda - Courtney Shoda Quote -
2 - courtney-shoda - Courtney Shoda Quote - https://chan.usc.edu/uploads/magazine/USC-Chan-Magazine-fall24.jpg
NOTE: See how the second parent loop has incorrect data for any single parent tag that was also used outside of the loop?
It seems like using the single parent tag outside of the loop increments that variable's count somehow.
Environment Details:
- Version: 7.5.25
- PHP Version 8.2
- MySQL Version N/A
- OS: N/A
- Web Server: N/A
Possible Solution
No idea.
Additional context
The documentation should probably also be updated to reflect that single tag use is possible.
- Lingua principale
- PHP
- Stelle
- 505
- Fork
- 135
- Merge medio
- 3g 7h
- PR unite (30g)
- 7
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un 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.
Altre issue di ExpressionEngine/ExpressionEngine
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
ExpressionEngine/ExpressionEngine#5453 ·
I maintainer di solito rispondono entro 1 giorno
-
RTE Custom Stylesheet causes warning: Trying to access array offset on value of type boolForse già presa @Yulyaswan l’ha presa 10 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ExpressionEngine/ExpressionEngine#5406 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ExpressionEngine/ExpressionEngine#5381 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: Accepted
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
ExpressionEngine/ExpressionEngine#5117 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
ExpressionEngine/ExpressionEngine#5066 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ExpressionEngine/ExpressionEngine
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Automattic/blocks-engine#4621 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
YunoHost-Apps/snappymail_ynh#205 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
Automattic/static-site-importer#2653 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug (unconfirmed) Search :mag:
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
FreshRSS/FreshRSS#9533 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
🏁 status: ready for work 💻 aspect: code 🛠 goal: fix 🟨 priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100