From f4386e97ee1e664e069b3959dc11c25a71718e11 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Fri, 3 Apr 2026 18:54:36 +0200 Subject: [PATCH] fix(cms): testimonials dict.items() collision in section macro testimonials.items in Jinja2 calls dict.items() method instead of accessing the 'items' key when sections are raw JSON dicts (POC builder pages). Fixed by using .get('items', []) with mapping check. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../cms/templates/cms/platform/sections/_testimonials.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/modules/cms/templates/cms/platform/sections/_testimonials.html b/app/modules/cms/templates/cms/platform/sections/_testimonials.html index 3863c5ed..dfdb9c07 100644 --- a/app/modules/cms/templates/cms/platform/sections/_testimonials.html +++ b/app/modules/cms/templates/cms/platform/sections/_testimonials.html @@ -20,10 +20,11 @@ {% endif %} - {# Testimonial cards #} - {% if testimonials.items %} + {# Testimonial cards — use .get() to avoid dict.items() method collision with JSON dicts #} + {% set testimonial_items = testimonials.get('items', []) if testimonials is mapping else [] %} + {% if testimonial_items %}
- {% for item in testimonials.items %} + {% for item in testimonial_items %}