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

Extra not found on Enum in production #220

Open
ker0x opened this issue Mar 28, 2023 · 5 comments
Open

Extra not found on Enum in production #220

ker0x opened this issue Mar 28, 2023 · 5 comments
Labels

Comments

@ker0x
Copy link

ker0x commented Mar 28, 2023

I have a weird behavior using extra with my enums on my production server.

An Error Occurred! Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("No value for extra "color" for enum case App\Core\Enum\AlertStatus::Success")." at /srv/app/templates/components/alert.html.twig line 1

This does not happen in dev or test environment and all my tests passed 😕 .

Server specs:

  • Symfony 6.2
  • PHP 8.2.4

Project:

Have you ever encountered such a problem?

@ogizanagi
Copy link
Member

Hi. Did you clear the cache in prod env in between your changes?

symfony console c:c -e prod

@ker0x
Copy link
Author

ker0x commented Mar 29, 2023

Hello!

Yes, the cache is clear after each deployment

@ker0x
Copy link
Author

ker0x commented Mar 30, 2023

Ok, I think i can confirm this is due to calling getExtra()

If i use a simple match expression, there is no more errors in production!

@ogizanagi
Copy link
Member

I didn't encounter such an issue so far, though 🤷🏻‍♂️

@Ecureuilvirtuel
Copy link

same problem here, extra not found on Enum in production.
I clear cache also but that not fix the issue

@ogizanagi ogizanagi added the Bug label Apr 10, 2023
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

3 participants