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

make compat with sf5.0 form and parameter type declarations in conjun… #169

Merged
merged 6 commits into from
Nov 22, 2020

Conversation

phiamo
Copy link
Contributor

@phiamo phiamo commented Nov 21, 2020

make compat with sf5.0 form and parameter type declarations in conjunction with the CollectionType

When using the Collection Type we get numbers (indice of the form collection) as keys, since they are int's
the symfony5.0 type declaration throws an exception since it requires a string.

Casting to string before all calls fixes this

I am targeting this branch, because it would make next version compatible with symfony5.0 as well.

Changelog

### Changed
- Cast form name to string for symfony5.0 compatibility

Copy link
Member

@VincentLanglet VincentLanglet left a comment

Choose a reason for hiding this comment

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

I kinda wonder if there is a way to cast the name somewhere else (before this class) in order to do the cast only once. But I have no idea;

src/EventListener/ResizeFormListener.php Outdated Show resolved Hide resolved
src/EventListener/ResizeFormListener.php Outdated Show resolved Hide resolved
src/EventListener/ResizeFormListener.php Outdated Show resolved Hide resolved
src/EventListener/ResizeFormListener.php Outdated Show resolved Hide resolved
@VincentLanglet VincentLanglet requested a review from a team November 21, 2020 18:43
@phiamo
Copy link
Contributor Author

phiamo commented Nov 22, 2020

I was wondering the same, but after thinking a bit about it, its the duty of this class to iterate over collections and detect size etc.
Just wondering how to symfony resize listener handles that case ...

@greg0ire greg0ire added the patch label Nov 22, 2020
Copy link
Contributor

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

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

I don't have a better solution to propose, so let's approve. This needs to be squash-merged (or you can squash it yourself, OP)

How to do that?

  1. git rebase -i origin/3.x, assuming origin is a git remote that points to this repository, and not your fork. If you're not sure what your remotes are, run git remote -vvv, there should be your fork and the holy/reference/base/origin/whatever-you-call-it repository.
  2. A window will show up with many lines, replace pick with fixup on every line but the first one
  3. Close your editor, git should do its magic, and you should end up with one commit
  4. Use git push --force to overwrite what you already push. Don't forget the --force option otherwise git will try to merge both things together.

@greg0ire greg0ire merged commit d7c2894 into sonata-project:1.x Nov 22, 2020
@greg0ire
Copy link
Contributor

Thanks @phiamo !

@SonataCI
Copy link
Collaborator

Ok @franmomu,

I requested a new release for form-extensions via Slack in #releases channel 👍

If you want to get notified about new releases, make sure to follow SonataNews on Twitter!

@sonata-project sonata-project deleted a comment from franmomu Nov 22, 2020
@franmomu
Copy link
Member

Just wondering how to symfony resize listener handles that case ...

They don't declare strict_types, I guess that's why it works.

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

Successfully merging this pull request may close these issues.

5 participants