Skip to content

Commit

Permalink
Fix fields when entity permissions are applied
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaykju authored Oct 19, 2023
1 parent 6b1722a commit 353b6bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Resources/views/crud/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

{% set ea_sort_asc = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Option\\SortOrder::ASC') %}
{% set ea_sort_desc = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Option\\SortOrder::DESC') %}
{% for field in entities|first.fields ?? [] %}
{% for field in entities|filter(e => e.isAccessible)|first.fields ?? [] %}
{% set is_sorting_field = ea.search.isSortingField(field.property) %}
{% set next_sort_direction = is_sorting_field ? (ea.search.sortDirection(field.property) == ea_sort_desc ? ea_sort_asc : ea_sort_desc) : ea_sort_desc %}
{% set column_icon = is_sorting_field ? (next_sort_direction == ea_sort_desc ? 'fa-arrow-up' : 'fa-arrow-down') : 'fa-sort' %}
Expand Down

0 comments on commit 353b6bc

Please sign in to comment.