8000 [FrameworkBundle] Fixed the registration of validation.xml file when the form is disabled by hason · Pull Request #9443 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Fixed the registration of validation.xml file when the form is disabled #9443

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
wants to merge 1 commit into from

Conversation

hason
Copy link
Contributor
@hason hason commented Nov 5, 2013
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

@fabpot
Copy link
Member
fabpot commented Nov 5, 2013

What do you mean by "when form is disabled"?

@stof
Copy link
Member
stof commented Nov 5, 2013

@fabpot in case you don't use forms in your project and are using the subtree splits (thus being able to drop the Form component entirely). FrameworkBundle does not require enabling forms

@hason
Copy link
Contributor Author
hason commented Nov 5, 2013
framework:
  form:
    enabled: false
  validation:
    enabled: true

$container->addResource(new FileResource($files[0]));
$files = array();

if (interface_exists('Symfony\Component\Form\FormInterface')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the classes do exist but there is not will for the validation to be plugged in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it's an imperfect solution, but it is consistent with other solutions - https://github.com/symfony/symfony/blob/2.2/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L539

@hason
Copy link
Contributor Author
hason commented Nov 7, 2013

The use case of this problem:

composer.json:

{
    "require": {
        "symfony/framework-bundle": "2.*",
        "symfony/validator": "2.*",
        "symfony/yml": "2.*"
    }
}

config.yml:

framework:
  validator:
    enabled: true

PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class Symfony\Component\Form\FormInterface does not exist' in /vendor/symfony/framework-bundle/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php:630

fabpot added a commit that referenced this pull request Nov 28, 2013
…file when the form is disabled (hason)

This PR was submitted for the 2.1 branch but it was merged into the 2.2 branch instead (closes #9443).

Discussion
----------

[FrameworkBundle] Fixed the registration of validation.xml file when the form is disabled

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

cfa5aa5 [FrameworkBundle] Fixed the registration of validation.xml file when the form is disabled
@fabpot fabpot closed this Nov 28, 2013
@hason hason deleted the fb_di branch November 28, 2013 11:29
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.

4 participants
0