8000 [BC Break][2.4][Form] The Symfony\Component\Intl\NumberFormatter\NumberFormatter::setAttribute() method's argument $attr value 2 behavior is not implemented · Issue #9838 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[BC Break][2.4][Form] The Symfony\Component\Intl\NumberFormatter\NumberFormatter::setAttribute() method's argument $attr value 2 behavior is not implemented #9838

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
Koc opened this issue Dec 22, 2013 · 8 comments

Comments

@Koc
Copy link
Contributor
Koc commented Dec 22, 2013

The form:

        $builder->add(
            'leave_year',
            null,
            array(
                'required'           => true,
                'label'              => 'form.employee.label.leave_year',
                'translation_domain' => 'OlolosoftVacationBundle',
                'disabled'           => true,
            )
        );

The Propel Model:

    /**
     * The value for the leave_year field.
     * @var        int
     */
    protected $leave_year;

It works on the 2.3 but on 2.4 got an exception:

Stack Trace (Plain Text)  -

[1] Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException: The Symfony\Component\Intl\NumberFormatter\NumberFormatter::setAttribute() method's argument $attr value 2 behavior is not implemented. The supported values for ROUNDING_MODE are: ROUND_HALFEVEN, ROUND_HALFDOWN, ROUND_HALFUP.  Please install the "intl" extension for full localization capabilities.
    at n/a
        in Z:\home\dev\ololo\vendor\symfony\symfony\src\Symfony\Component\Intl\NumberFormatter\NumberFormatter.php line 580

    at Symfony\Component\Intl\NumberFormatter\NumberFormatter->setAttribute('11', '2')
        in Z:\home\dev\ololo\vendor\symfony\symfony\src\Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer.php line 240

    at Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer->getNumberFormatter()
        in Z:\home\dev\ololo\vendor\symfony\symfony\src\Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer.php line 137

    at Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer->transform('2013')
        in Z:\home\dev\ololo\vendor\symfony\symfony\src\Symfony\Component\Form\Form.php line 1085

    at Symfony\Component\Form\Form->normToView('2013')
        in Z:\home\dev\ololo\vendor\symfony\symfony\src\Symfony\Component\Form\Form.php line 342

    at Symfony\Component\Form\Form->setData('2013')
        in Z:\home\dev\ololo\vendor\symfony\symfony\src\Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper.php line 57

    at Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper->mapDataToForms(object(VacationEmployee), object(RecursiveIteratorIterator))
        in Z:\home\dev\ololo\vendor\symfony\symfony\src\Symfony\Component\Form\Form.php line 385

    at Symfony\Component\Form\Form->setData(object(VacationEmployee))
        in Z:\home\dev\ololo\vendor\symfony\symfony\src\Symfony\Component\Form\Form.php line 477

    at Symfony\Component\Form\Form->initialize()
        in Z:\home\dev\ololo\vendor\symfony\symfony\src\Symfony\Component\Form\FormBuilder.php line 229

    at Symfony\Component\Form\FormBuilder->getForm()
        in Z:\home\dev\ololo\vendor\symfony\symfony\src\Symfony\Component\Form\FormFactory.php line 39

    at Symfony\Component\Form\FormFactory->create(object(VacationEmployeeType), object(VacationEmployee), array())
        in Z:\home\dev\ololo\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Controller\Controller.php line 163

    at Symfony\Bundle\FrameworkBundle\Controller\Controller->createForm(object(VacationEmployeeType), object(VacationEmployee))
        in Z:\home\dev\ololo\src\Rillsoft\VacationBundle\Controller\VacationEmployeeController.php line 327

    at Rillsoft\VacationBundle\Controller\VacationEmployeeController->formAction(object(Request))
        in  line 

    at call_user_func_array(array(object(VacationEmployeeController), 'formAction'), array(object(Request)))
        in Z:\home\dev\ololo\app\bootstrap.php.cache line 2913

    at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
        in Z:\home\dev\ololo\app\bootstrap.php.cache line 2885

    at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
        in Z:\home\dev\ololo\app\bootstrap.php.cache line 3024

    at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
        in Z:\home\dev\ololo\app\bootstrap.php.cache line 2305

    at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
        in Z:\home\dev\ololo\web\app_dev.php line 35
@Koc
Copy link
Contributor Author
Koc commented Dec 22, 2013

/cc @bschussek

@cordoval
Copy link
Contributor

@Koc if this is in a SE fork please push it reproducing the problem, it saves tons of time to @bschussek and whoever else really. Thanks!

@Koc
Copy link
Contributor Author
Koc commented Dec 22, 2013

Ok, will do

Koc added a commit to Koc/symfony-standard that referenced this issue Dec 24, 2013
@Koc
Copy link
Contributor Author
Koc commented Dec 24, 2013

@cordoval , @bschussek done. Referenced commit works fine with Symfony 2.3 and fails on 2.4.

@blackbourna
Copy link

I seem to be running into this issue as well...

@pamil
Copy link
Contributor
pamil commented Dec 29, 2013

@Koc I've forked your repo and when I'm running provided acme:test-form command, it does not even call NumberFormatter::setAttribute(). Are you sure it fails on provided codebase?

@Koc
Copy link
Contributor Author
Koc commented Dec 29, 2013

@pamil looks like you have intl extension installed.

@pamil
Copy link
Contributor
pamil commented Dec 29, 2013

@Koc That's true. Working on your issue right now :)

fabpot added a commit that referenced this issue Dec 31, 2013
…ROUND_DOWN, ROUND_UP (pamil)

This PR was squashed before being merged into the 2.4 branch (closes #9895).

Discussion
----------

[Intl] Added round support for ROUND_CEILING, ROUND_FLOOR, ROUND_DOWN, ROUND_UP

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no, actually it fixes some
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9838
| License       | MIT
| Doc PR        |

Adds support for 4 unsupported rounding modes (ROUND_CEILING, ROUND_FLOOR, ROUND_DOWN, ROUND_UP) in `NumberFormatter` from `Intl` component, so that `Symfony\Component\Form\Extension\Core\DataTransformer\IntegerToLocalizedStringTransformer` won't throw exception if `lib-intl` is not installed.

Commits
-------

f5fee9a [Intl] Added round support for ROUND_CEILING, ROUND_FLOOR, ROUND_DOWN, ROUND_UP
@fabpot fabpot closed this as completed Dec 31, 2013
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

5 participants
0