Skip to content

Commit

Permalink
Fix deprecation warning from passing null to str_replace (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkopinsky authored and gilles-g committed Aug 23, 2024
1 parent ee62d77 commit 8f5dd3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Event/Subscriber/DoctrineORMSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function filterEntity(GetFilterConditionEvent $event)

if ($dqlFrom = $event->getQueryBuilder()->getDQLPart('from')) {
$rootPart = reset($dqlFrom);
$fieldName = \str_replace(\sprintf('%s.', $rootPart->getAlias()), null, $event->getField());
$fieldName = \str_replace(\sprintf('%s.', $rootPart->getAlias()), '', $event->getField());
$metadata = $queryBuilder->getEntityManager()->getClassMetadata($rootPart->getFrom());

if (isset($metadata->associationMappings[$fieldName]) && (!$metadata->associationMappings[$fieldName]['isOwningSide'] || $metadata->associationMappings[$fieldName]['type'] === ClassMetadataInfo::MANY_TO_MANY)) {
Expand Down

0 comments on commit 8f5dd3e

Please sign in to comment.