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

Error when mixing localized and non-localized providers #1016

Closed
jawira opened this issue Feb 11, 2020 · 3 comments
Closed

Error when mixing localized and non-localized providers #1016

jawira opened this issue Feb 11, 2020 · 3 comments
Milestone

Comments

@jawira
Copy link
Contributor

jawira commented Feb 11, 2020

Hi, each one of the following code snippets works as expected:

\App\Entity\Zone:
  zone_{1..15}:
    name: '<city()>'
\App\Entity\Zone:
  zone_{1..15}:
    name: '<fr_BE:city()>'
\App\Entity\Zone:
  zone_{1..15}:
    name: '<randomElement(["North","East","West","South"])>'
\App\Entity\Zone:
  zone_{1..15}:
    name: '<randomElement(["North","East","West","South"])> <city()>'

But the following doesn't work:

\App\Entity\Zone:
  zone_{1..15}:
    name: '<randomElement(["North","East","West","South"])> <fr_BE:city()>'

This is the error I got:

In TolerantFixtureDenormalizer.php line 68:
                                                                               
  An error occurred while denormalizing the fixture "zone_{1..15}" (\App\Enti  
  ty\Zone): The value "<randomElement(["North","East","West","South"])> <fr_B  
  E:city()>" contains an unclosed function.                                    
                                                                               

In ExpressionLanguageExceptionFactory.php line 59:
                                                                               
  The value "<randomElement(["North","East","West","South"])> <fr_BE:city()>"  
   contains an unclosed function.                                              
                                                                               

hautelook:fixtures:load [-b|--bundle [BUNDLE]] [--no-bundles [NO-BUNDLES]] [-m|--manager MANAGER] [--append] [--shard SHARD] [--purge-with-truncate] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

Am I doing something wrong? Is this a bug?

IMO this is related with #956

@theofidry
Copy link
Member

Indeed looks to be an issue with the lexer :/

@theofidry theofidry added this to the 3.x milestone Feb 11, 2020
@jawira
Copy link
Contributor Author

jawira commented Feb 19, 2020

Also, this will work:

\App\Entity\Colleague:
  colleague_{1..100}:
    lastName: '<strtoupper(<lastName()>)>'

But this will not:

\App\Entity\Colleague:
  colleague_{1..100}:
    lastName: '<strtoupper(<fr_BE:lastName()>)>'

The output is:

In TolerantFixtureDenormalizer.php line 68:
                                                                               
  An error occurred while denormalizing the fixture "colleague_{1..100}" (\Ap  
  p\Entity\Colleague): The value "<strtoupper(<fr_BE:lastName()>)>" contains   
  an unclosed function.                                                        
                                                                               

In ExpressionLanguageExceptionFactory.php line 59:
                                                                               
  The value "<strtoupper(<fr_BE:lastName()>)>" contains an unclosed function.  

@jawira
Copy link
Contributor Author

jawira commented Jul 21, 2021

🦗

@jawira jawira closed this as completed Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants