8000 PropertyInfoLoader should not try to add validation to non-existent property by weaverryan · Pull Request #31936 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

PropertyInfoLoader should not try to add validation to non-existent property #31936

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public function loadClassMetadata(ClassMetadata $metadata)
continue;
}

if (!property_exists($className, $property)) {
continue;
}

$types = $this->typeExtractor->getTypes($className, $property);
if (null === $types) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ class PropertyInfoLoaderEntity
public $alreadyPartiallyMappedCollection;

public $readOnly;

public function setNonExistentField()
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function testLoadClassMetadata()
'alreadyMappedNotBlank',
'alreadyPartiallyMappedCollection',
'readOnly',
'nonExistentField',
Copy link
Member Author

Choose a reason for hiding this comment

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

No asserts were added, but, without the fix, these changes are enough to trigger an exception to be thrown while running this test.

])
;
$propertyInfoStub
Expand Down
0