Skip to content

[Form] Possible bug in \Symfony\Component\Form\ResolvedFormType #14919

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

Closed
c1tru55 opened this issue Jun 9, 2015 · 13 comments
Closed

[Form] Possible bug in \Symfony\Component\Form\ResolvedFormType #14919

c1tru55 opened this issue Jun 9, 2015 · 13 comments
Labels

Comments

@c1tru55
Copy link

c1tru55 commented Jun 9, 2015

When I try to call ResolvedFormType::getTypeExtensions() I get an error:

Attempted to call method "getExtensions" on class "Symfony\Component\Form\Extension\Core\Type\FormType".

As I see there are code for BC ( https://github.com/symfony/Form/blob/master/ResolvedFormType.php#L98 ):

    public function getTypeExtensions()
    {
        // BC
        if ($this->innerType instanceof AbstractType) {
            return $this->innerType->getExtensions();
        }

        return $this->typeExtensions;
    }

but we don't have use statement for deprecated AbstractType:

use Symfony\Component\Form\Exception\InvalidArgumentException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\OptionsResolver\OptionsResolver;

so it is assumed that deprecated AbstractType class is stored in the same folder as ResolvedFormType class. But current AbstractType is also stored in the same folder with ResolvedFormType and it doesn't have getExtensions() method: https://github.com/symfony/Form/blob/master/AbstractType.php

@xabbuh xabbuh added the Form label Jun 9, 2015
@c1tru55
Copy link
Author

c1tru55 commented Jun 9, 2015

symfony/form#15

@jakzal
Copy link
Contributor

jakzal commented Jun 9, 2015

@c1tru55 please submit PRs to the symfony/symfony repository, instead of specific component repositories (which are just mirrors).

@c1tru55
Copy link
Author

c1tru55 commented Jun 9, 2015

@jakzal done #14921
what about other 2.x branches?

@jakzal
Copy link
Contributor

jakzal commented Jun 9, 2015

@c1tru55 you should submit your PR to the oldest supported branch that you can reproduce this bug on. We merge older branches to the newer ones regularly.

@c1tru55
Copy link
Author

c1tru55 commented Jun 9, 2015

@jakzal it seems that this bug exists in all branches starting from 2.3, so I made PR to 2.8

@phansys
Copy link
Contributor

phansys commented Jun 9, 2015

@c1tru55
Copy link
Author

c1tru55 commented Jun 9, 2015

@jakzal what about this: #14922 ? 2.4 is the first branch where bug is present

@jakzal
Copy link
Contributor

jakzal commented Jun 9, 2015

2.4 is not supported. I think the bug is still present in 2.3, no?

However, even if you send a PR to 2.8, we can still merge it to 2.3. So don't worry about it too much.

@Tobion
Copy link
Contributor

Tobion commented Jun 9, 2015

This is already fixed #14896

@Tobion Tobion closed this as completed Jun 9, 2015
@phansys
Copy link
Contributor

phansys commented Jun 9, 2015

@c1tru55, just for future reference, if you can reproduce a bug in 2.3, you should make your PR against 2.3 (since 2.3 is the older maintained branch where that bug exists).

@phansys
Copy link
Contributor

phansys commented Jun 9, 2015

2.4 has reached EOM: https://symfony.com/roadmap.json?version=2.4
So, I think it should be done against 2.6 (which is the older branch with EOM not yet reached).
Please check also https://symfony.com/doc/current/contributing/community/releases.html#schedule.

@jakzal
Copy link
Contributor

jakzal commented Jun 9, 2015

@phansys @c1tru55 it's already fixed in 2.3 as Tobion mentioned. Soon it'll be merged into other branches.

@phansys
Copy link
Contributor

phansys commented Jun 9, 2015

Thanks @jakzal, @Tobion.

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

No branches or pull requests

5 participants