diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php index d27fc1784..ec1012136 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php @@ -11,6 +11,7 @@ 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; @@ -461,11 +462,13 @@ class ActivityType { $property = $field.'Visible'; - if (!property_exists($this, $property)) { + // Get the real class name (not the proxy) + $realClass = ClassUtils::getClass($this); + + if (!property_exists($realClass, $property)) { throw new \InvalidArgumentException('Field "'.$field.'" not found'); } - /* @phpstan-ignore-next-line */ return self::FIELD_INVISIBLE !== $this->{$property}; } diff --git a/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php b/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php index c6bbc11ea..a9b551b81 100644 --- a/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php +++ b/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php @@ -42,10 +42,8 @@ class TranslatableStringTwig extends AbstractExtension /** * Returns the name of the extension. - * - * @return The name of the extension */ - public function getName() + public function getName(): string { return 'chill_main_localize'; }