Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Validator] The PropertyInfoLoader should return early when disabled#32278

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@alanpoulain
Copy link
Contributor

QA
Branch?4.3
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

Related to:#31749 anddoctrine/DoctrineBundle#988.

If the auto-mapping was partially enabled for one resource (the Doctrine one), then the property info loader was applied for all the resources.

For instance, considering this configuration:

validation:auto_mapping:App\Entity\Foo:['doctrine.orm.default_entity_manager.validator_loader']

If there is aBar entity, then the loader is applied too.

publicfunctionloadClassMetadata(ClassMetadata$metadata)
{
$className =$metadata->getClassName();
if (null!==$this->classValidatorRegexp&& !preg_match($this->classValidatorRegexp,$className)) {
Copy link
Member

Choose a reason for hiding this comment

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

If null is passed, it means that it should be always executed IIRC.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@xabbuh
Copy link
Member

I guess we need to investigate why thePropertyInfoLoader is registered at all instead of trying to fiddle with the regex here. If I do not misunderstand the issue, this part should never be called here.

@nicolas-grekasnicolas-grekas added this to the4.3 milestoneJun 30, 2019
@alanpoulain
Copy link
ContributorAuthor

The code to remove thePropertyInfoLoader service is here:

if (!$propertyInfoEnabled || !$config['auto_mapping'] || !class_exists(PropertyInfoLoader::class)) {
$container->removeDefinition('validator.property_info_loader');
}

You can see it's the case only when there is no auto-mapping configuration at all.

@nicolas-grekasnicolas-grekas modified the milestones:4.3,4.4Feb 1, 2020
@fabpot
Copy link
Member

@xabbuh@dunglas As you are both skeptical about this change, can you confirm that this should be closed?

@fabpot
Copy link
Member

Closing for now as it's not clear if this is the right change.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dunglasdunglasdunglas left review comments

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

6 participants

@alanpoulain@xabbuh@fabpot@dunglas@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp