diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php index ec1012136..f8e871942 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php @@ -11,7 +11,6 @@ declare(strict_types=1); namespace Chill\ActivityBundle\Entity; -use Doctrine\Common\Util\ClassUtils; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation as Serializer; use Symfony\Component\Serializer\Annotation\Groups; @@ -463,7 +462,11 @@ class ActivityType $property = $field.'Visible'; // Get the real class name (not the proxy) - $realClass = ClassUtils::getClass($this); + $class = get_class($this); + if (str_contains($class, '__CG__')) { + $class = get_parent_class($this); + } + $realClass = $class; if (!property_exists($realClass, $property)) { throw new \InvalidArgumentException('Field "'.$field.'" not found');