Skip to content

Commit

Permalink
fix missing places for deprecating Pager::getNbResults() (#6748)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaicher authored Jan 6, 2021
1 parent 6b43d89 commit b3f2de4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Resources/views/CRUD/base_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ file that was distributed with this source code.
<label class="checkbox" for="{{ admin.uniqid }}_all_elements">
<input type="checkbox" name="all_elements" id="{{ admin.uniqid }}_all_elements">
{{ 'all_elements'|trans({}, 'SonataAdminBundle') }}
({{ admin.datagrid.pager.nbresults }})
{# NEXT_MAJOR: remove the attribute check and just use .countResults() #}
({{ attribute(admin.datagrid.pager, 'countResults') is defined ? admin.datagrid.pager.countResults() : admin.datagrid.pager.getNbResults() }})
</label>

<select name="action" style="width: auto; height: auto" class="form-control">
Expand Down
3 changes: 2 additions & 1 deletion src/Resources/views/Pager/base_results.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ file that was distributed with this source code.
{% endblock %}

{% block num_results %}
{% trans with {'%count%': admin.datagrid.pager.nbresults} from 'SonataAdminBundle' %}list_results_count{% endtrans %}
{# NEXT_MAJOR: remove the attribute check and just use .countResults() #}
{% trans with {'%count%': attribute(admin.datagrid.pager, 'countResults') is defined ? admin.datagrid.pager.countResults() : admin.datagrid.pager.getNbResults()} from 'SonataAdminBundle' %}list_results_count{% endtrans %}
&nbsp;-&nbsp;
{% endblock %}

Expand Down
3 changes: 2 additions & 1 deletion src/Resources/views/Pager/simple_pager_results.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ file that was distributed with this source code.
{% if admin.datagrid.pager.lastPage != admin.datagrid.pager.page %}
{{ 'list_results_count_prefix'|trans({}, 'SonataAdminBundle') }}
{% endif %}
{% trans with {'%count%': admin.datagrid.pager.nbresults} from 'SonataAdminBundle' %}list_results_count{% endtrans %}
{# NEXT_MAJOR: remove the attribute check and just use .countResults() #}
{% trans with {'%count%': attribute(admin.datagrid.pager, 'countResults') is defined ? admin.datagrid.pager.countResults() : admin.datagrid.pager.getNbResults()} from 'SonataAdminBundle' %}list_results_count{% endtrans %}
&nbsp;-&nbsp;
{% endblock %}

Expand Down

0 comments on commit b3f2de4

Please sign in to comment.