Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-30161: Handle form token in both custom and also for historical reasons default value #1431

Merged
merged 2 commits into from
May 14, 2019

Conversation

andrerom
Copy link
Contributor

@andrerom andrerom commented May 3, 2019

Since 5.0 ezxFormToken code has been operating in two modes:

  • Default pure legacy mode using ezxform_token as form name
  • Symfony mode using _token as form name (if symfony settings are in default state)

However quite some legacy code hard codes the default name, at least for javacript usage.
In 5.x this inconsistency was solved by setting Symfony to use field_name: ezxform_token

For Platform + legacy bridge that is no longer the case, and neither do we want to change the field_name by default. So this changes the logic so that ezxFormToken is cable of handling both at the same time.

Closes #1420

@thiagocamposviana Could you have a look and test if this solves your issue?

…easons default value

Since 5.0 FormToken code has been operating in two modes:
- Default pure legacy mode using `ezxform_token` as form name
- Symfony mode using `_token` as form name

Hoewever quite some legacy code hard codes the default name.
In 5.x this inconsistancy was solved by setting Symfony to use `field_name: ezxform_token`

For Platform + legacy bridge that is no longer a good default, so this changes the logic
so that ezxFormToken is cable of handling both at the same time.
@andrerom andrerom requested a review from emodric May 3, 2019 13:22
@andrerom andrerom changed the base branch from master to 2017.12 May 3, 2019 13:22
@andrerom andrerom requested a review from glye May 13, 2019 13:31
@andrerom andrerom added this to the 2019.03 milestone May 14, 2019
Copy link
Member

@glye glye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is nice! 👍 👍

extension/ezformtoken/event/ezxformtoken.php Outdated Show resolved Hide resolved
@andrerom andrerom merged commit fd3b34c into 2017.12 May 14, 2019
@andrerom andrerom deleted the EZP-30161 branch May 14, 2019 12:21
@thiagocamposviana
Copy link
Contributor

Just want to confirm it works nicely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants