Skip to content
Snippets Groups Projects
Commit 54284d21 authored by Florent Torregrosa's avatar Florent Torregrosa
Browse files

Issue #3484746 by grimreaper, pdureau: Use "is sequence" Twig test to prevent...

Issue #3484746 by grimreaper, pdureau: Use "is sequence" Twig test to prevent fatal errors when looping on slots
parent c7e38a64
Branches
Tags
1 merge request!215Issue #3484746 by grimreaper, pdureau: Use "is sequence" Twig test to prevent...
Pipeline #331259 passed with warnings
......@@ -17,6 +17,7 @@
{% set attributes = attributes.setAttribute('data-bs-interval', interval) %}
{% set attributes = attributes.setAttribute('data-bs-ride', data_bs_ride) %}
{% set carousel_id = carousel_id|default("carousel-" ~ random()) %}
{% set slides = slides is sequence ? slides : [slides] %}
<div{{ attributes.addClass('carousel').addClass('slide').setAttribute('id', carousel_id) }}>
......
{% if with_container %}
<div class="container">
{% endif %}
{% set attributes = gutters ? attributes.addClass(gutters) : attributes %}
{% set attributes = gutters_horizontal ? attributes.addClass(gutters_horizontal) : attributes %}
{% set attributes = gutters_vertical ? attributes.addClass(gutters_vertical) : attributes %}
{% set content = content is sequence ? content : [content] %}
{% if with_container %}
<div class="container">
{% endif %}
<div{{ attributes.addClass('row') }}>
{% for item in content %}
......
......@@ -3,6 +3,7 @@
{% endif %}
{% set list_type = list_type|default('ul') %}
{% set items = items is sequence ? items : [items] %}
<{{ list_type }}{{ attributes }}>
{% for item in items %}
......
......@@ -5,6 +5,7 @@
{% set attributes = card_header and 'pills' in variant ? attributes.addClass('card-header-pills') : attributes %}
{% endif %}
{% set tab_content = tab_content is sequence ? tab_content : [tab_content] %}
{% set nav_id = nav_id|default('nav-' ~ random()) %}
{% set nav_type = nav_type|default('ul') %}
{% set link_type = tab_content ? 'button' : 'a' %}
......
......@@ -18,6 +18,7 @@
{% set attributes = borders ? attributes.addClass('table-' ~ borders|lower|replace({'_': '-'})) : attributes %}
{% set attributes = hover ? attributes.addClass('table-hover') : attributes %}
{% set attributes = caption_top ? attributes.addClass('caption-top') : attributes %}
{% set colgroups = colgroups is sequence ? colgroups : [colgroups] %}
{% if header_color %}
{% set thead_attributes = thead_attributes.addClass('table-' ~ header_color|lower|replace({'_': '-'})) %}
......@@ -58,8 +59,9 @@
{% for colgroup in colgroups %}
{% if colgroup.cols %}
{% set colgroup_cols = colgroup.cols is sequence ? colgroup.cols : [colgroup.cols] %}
<colgroup{{ colgroup.attributes }}>
{% for col in colgroup.cols %}
{% for col in colgroup_cols %}
<col{{ col.attributes }} />
{% endfor %}
</colgroup>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment