Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form] Fix casting regression in DoctrineChoiceLoader#17006

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Tobion merged 1 commit intosymfony:2.7frombendavies:id-reader-casting
Dec 15, 2015
Merged

[Form] Fix casting regression in DoctrineChoiceLoader#17006

Tobion merged 1 commit intosymfony:2.7frombendavies:id-reader-casting
Dec 15, 2015

Conversation

@bendavies
Copy link
Contributor

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsN/A
LicenseMIT
Doc PRN/A

In symfony 2.7, theDoctrineChoiceLoader andIdReader were introduce to replace the deprecatedEntityChoiceList

There appears to have been a change in behaviour in the refactor, as the oldEntityChoiceListcasts ID to strings, whereas the newDoctrineChoiceLoaderdoes not. The casting behavior wasmaintained elsewhere, however.

Since the newDoctrineChoiceLoader deprecatedEntityChoiceList, i'm calling this a regression.

@Tobion
Copy link
Contributor

What does this fix? What type is the id value that you want to cast?

@bendavies
Copy link
ContributorAuthor

Well, does that even matter? It's a regression right?
But for info,https://github.com/ramsey/uuid-doctrine

@Tobion
Copy link
Contributor

Just because the new version doesn't behave exactly like the deprecated one doesn't mean it's a regression.

@Tobion
Copy link
Contributor

Btw, for your use-case the string case is not safe to use anyway, because thehttps://github.com/ramsey/uuid/blob/master/src/UuidInterface.php does not mandate a__toString method.

@bendavies
Copy link
ContributorAuthor

If you don't want to classify it as a regression, fine, although the feels like a stretch in this particular case.

My change is making the behaviour consistent throughout the class. It's casted to string in one place but not a other.

My particular use case has no relevance in the discussion.

@bendavies
Copy link
ContributorAuthor

Thoughts@webmozart? Since you wrote it.

@eXtreme
Copy link
Contributor

Well it is used as a key in an array and ID in doctrine can be a value object.

@webmozart
Copy link
Contributor

I think it's fine to make this change. Could you add a test case though?

@bendavies
Copy link
ContributorAuthor

@webmozart thanks, will do

@bendavies
Copy link
ContributorAuthor

@webmozart how's that?

@webmozart
Copy link
Contributor

👍

@Tobion
Copy link
Contributor

Thank you@bendavies.

@TobionTobion merged commit54bbade intosymfony:2.7Dec 15, 2015
Tobion added a commit that referenced this pull requestDec 15, 2015
…davies)This PR was merged into the 2.7 branch.Discussion----------[Form] Fix casting regression in DoctrineChoiceLoader| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | N/A| License       | MIT| Doc PR        | N/AIn symfony 2.7, the [DoctrineChoiceLoader](https://github.com/symfony/symfony/blob/9543b36a34221aaca9f2f3cfe34112e8468a591a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php) and [IdReader](https://github.com/symfony/symfony/blob/9543b36a34221aaca9f2f3cfe34112e8468a591a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php) were introduce to replace the deprecated [EntityChoiceList](https://github.com/symfony/symfony/blob/9543b36a34221aaca9f2f3cfe34112e8468a591a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php)There appears to have been a change in behaviour in the refactor, as the old `EntityChoiceList` [casts ID to strings](https://github.com/symfony/symfony/blob/9543b36a34221aaca9f2f3cfe34112e8468a591a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php#L248), whereas the new `DoctrineChoiceLoader` [does not](https://github.com/symfony/symfony/blob/2.7/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php#L159). The casting behavior was [maintained elsewhere](https://github.com/symfony/symfony/blob/2.7/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php#L122), however.Since the new `DoctrineChoiceLoader` deprecated `EntityChoiceList`, i'm calling this a regression.Commits-------54bbade [Form] cast IDs to match deprecated behaviour of EntityChoiceList
@bendavies
Copy link
ContributorAuthor

Thanks@Tobion

This was referencedDec 26, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@bendavies@Tobion@eXtreme@webmozart@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp