- Issue created by @in0ni
- Merge request !9Issue #3460029: Media object always created when using debugging twig β (Open) created by in0ni
- Status changed to Needs review
4 months ago 4:35pm 9 July 2024 - Status changed to Needs work
4 months ago 4:59pm 9 July 2024 - πΊπΈUnited States in0ni
Excuse the noise, but after further testing -- this solution requires additional work.
- πΊπΈUnited States dcam
Even if you're able to fix the problem for media, it will still be an issue for other fields. The Twig debug setting is just problematic for a view like this. That's why I included a note about it in the documentation. Personally, if I have to work with a timeline, then I just shut the debug setting off. You may want to consider implementing a custom template for the media field in your theme that uses Twig filters to strip the comments. Someone else with a similar problem posted a link to this Stack Overflow thread about it: https://drupal.stackexchange.com/questions/201275/possible-to-turn-off-t.... That might be simpler.
- Status changed to Needs review
4 months ago 5:35pm 9 July 2024 - πΊπΈUnited States in0ni
Ok, just finished up and seeing your comment. I did notice that for other fields this will be a similar issue, but particularly with this field it's problematic as it causes a rendering issue. (for example background I just left as-is since it does not cause any problems).
To be quite honest, I read through the documentation (perhaps not 100%) and did not find a note about this.
Also, I find the solution of having to turn off twig debug to be problematic and not optimal. You know the module well, but think of a team of developers who always have it on, or someone new that joints a team who always work with it on... it becomes a difficult thing to communicate. I can easily see someone wasting time, not understanding why a box appears for an image when there isn't one.
The timeline should render properly (visually) as to not confuse, even with twig debug IMO.