mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
Remove hard coded _token field
This commit is contained in:
parent
f4add488e4
commit
f65c47a900
37 changed files with 21 additions and 35 deletions
|
|
@ -8,7 +8,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
{{ form_end(form, {render_rest: false}) }}
|
{{ form_end(form, {render_rest: false}) }}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with {
|
{% hook 'form' with {
|
||||||
mapped_product_attributes,
|
mapped_product_attributes,
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
{% if hookable_metadata.configuration.method is defined %}
|
{% if hookable_metadata.configuration.method is defined %}
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form, sylius_test_form_attribute('form-validation-errors')) }}
|
{{ form_errors(form, sylius_test_form_attribute('form-validation-errors')) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form, resource } %}
|
{% hook 'form' with { form, resource } %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
{{ form_start(form, {'attr': {'novalidate': 'novalidate', 'id': form.vars.id}}) }}
|
{{ form_start(form, {'attr': {'novalidate': 'novalidate', 'id': form.vars.id}}) }}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,4 @@
|
||||||
|
|
||||||
{{ form_start(form, {'action': path('sylius_admin_request_password_reset'), 'attr': {'class': 'ui large loadable form', 'novalidate': 'novalidate'}}) }}
|
{{ form_start(form, {'action': path('sylius_admin_request_password_reset'), 'attr': {'class': 'ui large loadable form', 'novalidate': 'novalidate'}}) }}
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,4 @@
|
||||||
|
|
||||||
{{ form_start(form, {'action': path('sylius_admin_password_reset', {'token': app.request.attributes.get('token')}), 'attr': {'class': 'ui large loadable form', 'novalidate': 'novalidate'}}) }}
|
{{ form_start(form, {'action': path('sylius_admin_password_reset', {'token': app.request.attributes.get('token')}), 'attr': {'class': 'ui large loadable form', 'novalidate': 'novalidate'}}) }}
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
<input type="hidden" name="_method" value="PUT"/>
|
<input type="hidden" name="_method" value="PUT"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form, resource } %}
|
{% hook 'form' with { form, resource } %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -87,3 +87,12 @@
|
||||||
{% set attr = attr|merge({'class': (attr.class|default('') ~ ' btn btn-outline-primary')|trim}) %}
|
{% set attr = attr|merge({'class': (attr.class|default('') ~ ' btn btn-outline-primary')|trim}) %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{%- endblock -%}
|
{%- endblock -%}
|
||||||
|
|
||||||
|
{%- block form_end -%}
|
||||||
|
{% for child in form %}
|
||||||
|
{% if 'csrf_token' in child.vars.block_prefixes and child.rendered == false %}
|
||||||
|
{{ form_row(child) }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</form>
|
||||||
|
{%- endblock form_end -%}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
{{ 'sylius.ui.ship'|trans }}
|
{{ 'sylius.ui.ship'|trans }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
<input type="hidden" name="_method" value="{{ hookable_metadata.configuration.method }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,5 @@
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
{% import '@SyliusShop/shared/buttons.html.twig' as buttons %}
|
{% import '@SyliusShop/shared/buttons.html.twig' as buttons %}
|
||||||
|
|
||||||
|
{% form_theme form '@SyliusShop/form/theme.html.twig' %}
|
||||||
|
|
||||||
<div {{ attributes }}>
|
<div {{ attributes }}>
|
||||||
{{ form_start(form, {'action': path('sylius_shop_account_address_book_set_as_default', {'id': hookable_metadata.context.address.id})}) }}
|
{{ form_start(form, {'action': path('sylius_shop_account_address_book_set_as_default', {'id': hookable_metadata.context.address.id})}) }}
|
||||||
<input type="hidden" name="_method" value="PATCH" />
|
<input type="hidden" name="_method" value="PATCH" />
|
||||||
<input type="hidden" name={{ form.defaultAddress.vars['full_name'] }} value={{ hookable_metadata.context.address.id }} />
|
<input type="hidden" name={{ form.defaultAddress.vars['full_name'] }} value={{ hookable_metadata.context.address.id }} />
|
||||||
{{ buttons.submit('sylius.ui.set_as_default'|trans, 'set-as-default-button', null, 'btn-sm btn-icon btn-outline-gray w-full') }}
|
{{ buttons.submit('sylius.ui.set_as_default'|trans, 'set-as-default-button', null, 'btn-sm btn-icon btn-outline-gray w-full') }}
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,5 @@
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,5 @@
|
||||||
<div>
|
<div>
|
||||||
{{ form_start(form, {'action': path('sylius_shop_request_password_reset_token'), 'attr': {'novalidate': 'novalidate'}}) }}
|
{{ form_start(form, {'action': path('sylius_shop_request_password_reset_token'), 'attr': {'novalidate': 'novalidate'}}) }}
|
||||||
{% hook 'form' %}
|
{% hook 'form' %}
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
<div {{ attributes }}>
|
<div {{ attributes }}>
|
||||||
{{ form_start(form, {'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate'}}) }}
|
{{ form_start(form, {'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate'}}) }}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_row(form._token) }}
|
|
||||||
<input type="hidden" name="_method" value="PUT" />
|
<input type="hidden" name="_method" value="PUT" />
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
<div {{ attributes }}>
|
<div {{ attributes }}>
|
||||||
{{ form_start(form, {'action': path('sylius_shop_register'), 'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate', 'id': form.vars.id}}) }}
|
{{ form_start(form, {'action': path('sylius_shop_register'), 'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate', 'id': form.vars.id}}) }}
|
||||||
{{ form_row(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,4 @@
|
||||||
|
|
||||||
{% hook 'form' %}
|
{% hook 'form' %}
|
||||||
|
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {render_rest: hookable.configuration.render_rest|default(false)}) }}
|
{{ form_end(form, {render_rest: hookable.configuration.render_rest|default(false)}) }}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
{{ form_start(form, {'action': path('sylius_shop_cart_checkout'), 'attr': {'novalidate': 'novalidate', 'id': form.vars.id}}) }}
|
{{ form_start(form, {'action': path('sylius_shop_cart_checkout'), 'attr': {'novalidate': 'novalidate', 'id': form.vars.id}}) }}
|
||||||
<input type="hidden" name="_method" value="PATCH"/>
|
<input type="hidden" name="_method" value="PATCH"/>
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{{ form_widget(form._token) }}
|
|
||||||
|
|
||||||
{% hook 'form' with { form } %}
|
{% hook 'form' with { form } %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,5 @@
|
||||||
|
|
||||||
{% hook 'form' with { form, order: resource, email_exists: emailExists } %}
|
{% hook 'form' with { form, order: resource, email_exists: emailExists } %}
|
||||||
|
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {render_rest: hookable.configuration.render_rest|default(false)}) }}
|
{{ form_end(form, {render_rest: hookable.configuration.render_rest|default(false)}) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,4 @@
|
||||||
|
|
||||||
{% hook 'form' %}
|
{% hook 'form' %}
|
||||||
|
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,5 @@
|
||||||
|
|
||||||
{% hook 'form' with { form, order: resource } %}
|
{% hook 'form' with { form, order: resource } %}
|
||||||
|
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,5 @@
|
||||||
|
|
||||||
{% hook 'form' %}
|
{% hook 'form' %}
|
||||||
|
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,4 @@
|
||||||
|
|
||||||
{{ form_start(form, {'action': path('sylius_shop_contact_request'), 'attr': {'novalidate': 'novalidate'}}) }}
|
{{ form_start(form, {'action': path('sylius_shop_contact_request'), 'attr': {'novalidate': 'novalidate'}}) }}
|
||||||
{% hook 'form' %}
|
{% hook 'form' %}
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
|
|
|
||||||
|
|
@ -73,3 +73,12 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{%- block form_end -%}
|
||||||
|
{% for child in form %}
|
||||||
|
{% if 'csrf_token' in child.vars.block_prefixes and child.rendered == false %}
|
||||||
|
{{ form_row(child) }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</form>
|
||||||
|
{%- endblock form_end -%}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
|
|
||||||
{% hook 'form' %}
|
{% hook 'form' %}
|
||||||
|
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ messages.info('sylius.ui.you_can_no_longer_change_payment_method_of_this_order') }}
|
{{ messages.info('sylius.ui.you_can_no_longer_change_payment_method_of_this_order') }}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
{% hook 'add_to_cart' with { product, form } %}
|
{% hook 'add_to_cart' with { product, form } %}
|
||||||
|
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,5 @@
|
||||||
|
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
|
|
||||||
{{ form_row(form._token) }}
|
|
||||||
{{ form_end(form, {'render_rest': false}) }}
|
{{ form_end(form, {'render_rest': false}) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue