Skip to content

Commit

Permalink
[REF] check that ID exists
Browse files Browse the repository at this point in the history
  • Loading branch information
n3o77 committed Jan 24, 2024
1 parent 17e1612 commit b46cd39
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Resources/views/column_types/actions.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
{% if action.template is defined and action.template %}
{% include action.template with {'action': action, 'data': data, 'column': column} only %}
{% else %}
<a class="btn btn-light btn-sm"{% if action.route %} href="{{ path(action.route, {'id': column.type.value(action.path|default('id'), data)}) }}"{% endif %}>
<span class="{{ action.icon }}"></span>
{{ action.label|trans }}
</a>
{% set id = column.type.value(action.path|default('id'), data) %}
{% if id %}
<a class="btn btn-light btn-sm"{% if action.route %} href="{{ path(action.route, {'id': id}) }}"{% endif %}>
<span class="{{ action.icon }}"></span>
{{ action.label|trans }}
</a>
{% endif %}
{% endif %}
{% endfor %}
</div>
Expand Down

0 comments on commit b46cd39

Please sign in to comment.