Open
Description
There is a BC break in LiveComponentHydrator as it now throws an exception when dehydrating a User entity class extending UserInterface.
In \Symfony\UX\LiveComponent\LiveComponentHydrator::dehydrateObjectValue
the $classType
parameter value is the interface not the class as it was before (in LegacyLivePropMetadata
).
The component looks like this:
<?php
declare(strict_types=1);
namespace App\Component;
use App\Controller\BaseController;
use App\Entity\User;
use App\Form\Type\UserAdminType;
use Symfony\Component\Form\FormInterface;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
use Symfony\UX\LiveComponent\Attribute\LiveProp;
use Symfony\UX\LiveComponent\ComponentWithFormTrait;
use Symfony\UX\LiveComponent\DefaultActionTrait;
#[AsLiveComponent('user_admin_form')]
final class UserAdminForm extends BaseController
{
use DefaultActionTrait;
use ComponentWithFormTrait;
#[LiveProp]
public User $user;
protected function instantiateForm(): FormInterface
{
return $this->createForm(UserAdminType::class, $this->user, ['is_edit' => true]);
}
}