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

BC break for tilde fields #1634

Closed
kix opened this issue Jul 18, 2016 · 7 comments
Closed

BC break for tilde fields #1634

kix opened this issue Jul 18, 2016 · 7 comments

Comments

@kix
Copy link

kix commented Jul 18, 2016

After this commit, having a tilde (~) in an entity's field configuration leads to a fatal error, as the extracted method has an array typehint, yet the tilde translates to null.

@kix
Copy link
Author

kix commented Jul 18, 2016

Versions after 2.4.16 seem to be affected by this.

@vbartusevicius
Copy link
Contributor

vbartusevicius commented Jul 18, 2016

@kix - please give some more information, i.e. exact field name and the error you're getting.

@kix
Copy link
Author

kix commented Jul 18, 2016

@vbartusevicius, here's the YAML config:

UserBundle\Entity\OAuth:
    type: entity
    table: user_oauth
    id:
        id:
            type: integer
            generator:
                strategy: AUTO
    fields:
        provider: ~
        identifier: ~
        accessToken:
            column: access_token
            nullable: true
        refreshToken:
            column: refresh_token
            nullable: true
    manyToOne:
        user:
            targetEntity: UserBundle\Entity\User
            joinColumn:
                nullable: false
            inversedBy: oauthAccounts
    uniqueConstraints:
        -
            columns: [user_id, provider]
        -
            columns: [provider, identifier]

And the error I get is:

  [RuntimeException]                                                                                                                                                                                                                                                                                                         
  An error occurred when executing the "'cache:clear --no-warmup'" command:                                                                                                                                                                                                                                                  

    [Symfony\Component\Debug\Exception\ContextErrorException]                                                                                                                                                                                                                                                                
    Catchable Fatal Error: Argument 2 passed to Gedmo\Translatable\Mapping\Driver\Yaml::buildFieldConfiguration() must be of the type array, null given, called in /drone/src/github.com/api/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Mapping/Driver/Yaml.php on line 51 and defined    

This was referenced Jul 18, 2016
@vbartusevicius
Copy link
Contributor

Added PRs to 2.4.x and master branches. @l3pp4rd - please add patch tag to propagate the changes to packagist.

@kix
Copy link
Author

kix commented Jul 18, 2016

@vbartusevicius, thanks for fixing this so quick :)

@vbartusevicius
Copy link
Contributor

Well, I left a major bug there... :)

l3pp4rd added a commit that referenced this issue Jul 19, 2016
l3pp4rd added a commit that referenced this issue Jul 19, 2016
@filipe-x
Copy link

Hello There

You left the same bug in other extensions,
See for example sluggable extension, the same bug extists in file YAML.php

Please consider resolving
Thanks :)

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

No branches or pull requests

3 participants