From b475cfdd6c5176399020a3139bc6ad900b36da58 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Mon, 16 Dec 2019 21:02:43 +0100 Subject: [PATCH] Use apply tag instead of filter and fix for loop https://twig.symfony.com/doc/1.x/tags/apply.html https://twig.symfony.com/doc/2.x/deprecated.html#tags "The filter tag is deprecated in Twig 2.9. Use the apply tag instead (the Twig\TokenParser\FilterTokenParser classes is also deprecated)." and "Adding an if condition on a for tag is deprecated in Twig 2.10. Use a filter filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop)" Signed-off-by: William Desportes --- templates/home/index.twig | 4 ++-- templates/scripts.twig | 4 +++- templates/server/replication/index.twig | 4 ++-- templates/server/replication/slave_configuration.twig | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/templates/home/index.twig b/templates/home/index.twig index 498011b740..e0fb63a4d7 100644 --- a/templates/home/index.twig +++ b/templates/home/index.twig @@ -15,11 +15,11 @@

{% trans 'phpMyAdmin Demo Server' %}

- {% filter format('demo.phpmyadmin.net')|raw %} + {% apply format('demo.phpmyadmin.net')|raw %} {% trans %} You are using the demo server. You can do anything here, but please do not change root, debian-sys-maint and pma users. More information is available at %s. {% endtrans %} - {% endfilter %} + {% endapply %}

{% endif %} diff --git a/templates/scripts.twig b/templates/scripts.twig index 0b0f7c94e1..13a29a3091 100644 --- a/templates/scripts.twig +++ b/templates/scripts.twig @@ -13,8 +13,10 @@ AJAX.scriptHandler {% endfor %} ; $(function() { -{% for file in files if file.has_onload %} +{% for file in files %} + {% if file.has_onload %} AJAX.fireOnload('{{ file.filename|escape_js_string }}'); + {% endif %} {% endfor %} }); {% endif %} diff --git a/templates/server/replication/index.twig b/templates/server/replication/index.twig index b6ed7316f1..c40df0dda6 100644 --- a/templates/server/replication/index.twig +++ b/templates/server/replication/index.twig @@ -12,11 +12,11 @@ {% elseif master_configure is null and clear_screen is null %}
{% trans 'Master replication' %} - {% filter format('', '')|raw %} + {% apply format('', '')|raw %} {% trans %} This server is not configured as master in a replication process. Would you like to %sconfigure%s it? {% endtrans %} - {% endfilter %} + {% endapply %}
{% endif %} diff --git a/templates/server/replication/slave_configuration.twig b/templates/server/replication/slave_configuration.twig index b205ccfb4a..5b12ea7adf 100644 --- a/templates/server/replication/slave_configuration.twig +++ b/templates/server/replication/slave_configuration.twig @@ -99,11 +99,11 @@ {% elseif not has_slave_configure %} - {% filter format('', '')|raw %} {% trans 'This server is not configured as slave in a replication process. Would you like to %sconfigure%s it?' %} - {% endfilter %} + {% endapply %} {% endif %}