Fix error when options['customButtons'] is empty

This commit is contained in:
Marc Ducobu 2021-08-17 15:23:57 +02:00
parent f58be46466
commit a58bdb466c

View File

@ -92,14 +92,16 @@
{{ options['customButtons']['before'] }}
{% endif %}
{%- if options['customButtons']['replace'] is not defined and is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) -%}
{% if options['customButtons']['replace'] is defined %}
{{ options['customButtons']['replace'] }}
{% elseif is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) %}
<li>
<a class="btn btn-sm btn-show" target="_blank" title="{{ 'Show thirdparty'|trans }}"
href="{{ path('chill_3party_3party_show', { thirdparty_id: thirdparty.id }) }}"></a>
</li>
{%- else -%}
{{ options['customButtons']['replace'] }}
{%- endif -%}
{% else %}
{# rien faire ? j'ai eu un bug car options['customButtons'] était vide (marc) #}
{% endif %}
{% if options['customButtons']['after'] is defined %}
{{ options['customButtons']['after'] }}