Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Translation] Fix the string casting in the XliffFileLoader #15619

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

Merged
merged 1 commit into from
Aug 26, 2015

Conversation

stof
Copy link
Member

@stof stof commented Aug 26, 2015

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/a

#15611 broke the usage of Xliff translation files (and so all Symfony projects as they are used in core) because it stores SimpleXmlElement instances in the MessageCatalogue, which breaks when loading the cache:

PHP Fatal error:  Call to undefined method SimpleXMLElement::__set_state() in .../app/cache/test/translations/catalogue.en.1cd7e874b24ab41081c7781e4161053bf515fc91.php on line 9

this is how the cache looks like (truncated a lot of course):

$catalogue = new MessageCatalogue('en', array (
  'validators' => 
  array (
    'This value should be false.' => 
    SimpleXMLElement::__set_state(array(
       0 => 'This value should be false.',
    )),
  ),
));

This is a critical bug in the 2.3 and 2.7 branches

@wouterj
Copy link
Member

wouterj commented Aug 26, 2015

👍 Discovered this yesterday in the CmfMenuBundle tests.

Status: Reviewed

@aitboudad
Copy link
Contributor

👍

@stof
Copy link
Member Author

stof commented Aug 26, 2015

@aitboudad can you merge this (and propagate to 2.7) ? This bug is annoying

@aitboudad
Copy link
Contributor

@stof sure

@aitboudad
Copy link
Contributor

Thank you @stof.

@aitboudad aitboudad merged commit b856f62 into symfony:2.3 Aug 26, 2015
aitboudad added a commit that referenced this pull request Aug 26, 2015
…r (stof)

This PR was merged into the 2.3 branch.

Discussion
----------

[Translation] Fix the string casting in the XliffFileLoader

| 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/a

#15611 broke the usage of Xliff translation files (and so all Symfony projects as they are used in core) because it stores SimpleXmlElement instances in the MessageCatalogue, which breaks when loading the cache:

```
PHP Fatal error:  Call to undefined method SimpleXMLElement::__set_state() in .../app/cache/test/translations/catalogue.en.1cd7e874b24ab41081c7781e4161053bf515fc91.php on line 9
```

this is how the cache looks like (truncated a lot of course):

```php

$catalogue = new MessageCatalogue('en', array (
  'validators' =>
  array (
    'This value should be false.' =>
    SimpleXMLElement::__set_state(array(
       0 => 'This value should be false.',
    )),
  ),
));
```

This is a critical bug in the 2.3 and 2.7 branches

Commits
-------

b856f62 [Translation] Fix the string casting in the XliffFileLoader
@stof stof deleted the fix_xliff_loader branch August 26, 2015 10:25
@stof
Copy link
Member Author

stof commented Aug 26, 2015

@aitboudad can you propagate it to 2.7 too as the bug was already propagated there ?

@aitboudad
Copy link
Contributor

@stof there are many conflict, should I open PR for 2.7 or apply a cherry-pick ?

@nicolas-grekas
Copy link
Member

I merged 2.3 in 2.7

@aitboudad
Copy link
Contributor

@nicolas-grekas thank you :)

@stof
Copy link
Member Author

stof commented Aug 26, 2015

@aitboudad many conflicts ? The merge done by @nicolas-grekas shows a single conflict on the line changed here (which is the same conflict than the one you had to resolved for the propagation of your buggy PR btw)

@nicolas-grekas
Copy link
Member

because of the other conflicts I had on the merge just before I believe

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

Successfully merging this pull request may close these issues.

5 participants