]> git.agnieray.net Git - galette.git/commitdiff
Prevent extra variables to be passed from include
authorJohan Cwiklinski <johan@x-tnd.be>
Mon, 19 Feb 2024 08:04:28 +0000 (09:04 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Mon, 19 Feb 2024 09:23:07 +0000 (10:23 +0100)
refs #1774

galette/templates/default/elements/js/modal_action.js.twig

index ceaa0411182a4f36f9b83ae8bb18c2559658acd2..e7ebb208a9f2b98d79b4a1df2bb0fb7b40d72c9a 100644 (file)
                     modal_cancel_text: modal_cancel_text,
                 } %}
             },
-            {# FIXME: variables modal.js.twig know and that are not explicitely redefined are autmatically passed! #}
             error: function() {
+                {# Use "only" keyword to prevent known but not explicitiely defined variables to be passed #}
                 {% include "elements/js/modal.js.twig" with {
                     modal_title_twig: _T("An error occurred :(")|e("js"),
                     modal_without_content: true,
                     modal_deny_only: true,
                     modal_cancel_text: _T("Close")|e("js"),
                     modal_classname: "redalert",
-                } %}
+                } only %}
             }
         });
     });