-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle][DX] Display a nice error message if an enabled component is missing #25094
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
[FrameworkBundle][DX] Display a nice error message if an enabled component is missing #25094
Conversation
derrabus
commented
Nov 21, 2017
Q | A |
---|---|
Branch? | 3.4 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #25093 |
License | MIT |
Doc PR | N/A |
Could you please check if that happens for other components also? |
@@ -232,6 +232,10 @@ public function load(array $configs, ContainerBuilder $container) | |||
} | |||
|
|||
if ($this->isConfigEnabled($container, $config['form'])) { | |||
if (!class_exists('Symfony\Component\Form\Form')) { | |||
throw new LogicException('Form support cannot be enabled. Please install the Form component.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to match similar messages:
Form support cannot be enabled as the Form component is not installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
For other components we did this in 3.3. Should we merge the PR into the |
@nicolas-grekas Serializer is also affected. I can enable the component without having it installed and FrameworkBundle would register the |
I've also checked the validator: When enabling it, |
4b86116
to
e31badc
Compare
Do you think, we can remove those lines? symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php Lines 181 to 183 in 4c93028
Installing Validator without Translation is not possible, enabling validation without the Validator component will be caught elsewhere. So this block just generates a confusing error message. |
e31badc
to
127b9de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's go for 3.3
127b9de
to
2b45805
Compare
3.3 it is, then. |
Thank you @derrabus. |
…nabled component is missing (derrabus) This PR was merged into the 3.3 branch. Discussion ---------- [FrameworkBundle][DX] Display a nice error message if an enabled component is missing | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25093 | License | MIT | Doc PR | N/A Commits ------- 2b45805 Display a nice error message if the form/serializer component is missing.
@derrabus about #25094 (comment), you reverted your idea? |
@nicolas-grekas For now, yes. That change conflicted with the 3.3 branch. I will setup a 3.3 app tonight and test again. |