Repository: EasyCorp/EasyAdminBundle (language: php)

Issue:
FormField::addPanel() generate user notice on Symfony 6.2+
Adding a FormField::addPanel() generate a user notice on Symfony 6.2.x when the option enable_lazy_ghost_objects: true is present inside the doctrine.yaml config.

Notice is thrown here when trying to access a property on the entity that obviously doesn't exist.

in src/Field/Configurator/CommonPreConfigurator.php

``` 
try {
                $value = null === $entityDto->getInstance() ? null : $this->propertyAccessor->getValue($entityDto->getInstance(), $field->getProperty());
            } catch (AccessException|UnexpectedTypeException) {
                $isReadable = false;
            }
```

Related issue in symfony : 

https://github.com/symfony/symfony/issues/48970

Putting the option то : option enable_lazy_ghost_objects: false solve the issue.

![Capture d’écran 2023-02-10 à 13 14 11](https://user-images.githubusercontent.com/1983686/218078971-957d5069-8d51-448b-bcb7-567db2e97226.png)




Discussion / hints:
I have just encountered the same issue (but with tabs). What is weird is that it triggers on some entity instances and not on the others (even within the same CRUD). I am investigating right now to maybe find the reason it fires, but only *sometimes*. Will surely report back if I find anything.

Fix patch:
diff --git a/src/Field/FormField.php b/src/Field/FormField.php
index a8145c24c2..2a72ac5454 100644
--- a/src/Field/FormField.php
+++ b/src/Field/FormField.php
@@ -50,7 +50,8 @@ public static function addPanel($label = false, ?string $icon = null): self
             ->setFormTypeOptions(['mapped' => false, 'required' => false])
             ->setCustomOption(self::OPTION_ICON, $icon)
             ->setCustomOption(self::OPTION_COLLAPSIBLE, false)
-            ->setCustomOption(self::OPTION_COLLAPSED, false);
+            ->setCustomOption(self::OPTION_COLLAPSED, false)
+            ->setValue(true);
     }
 
     /**
@@ -73,7 +74,8 @@ public static function addRow(string $breakpointName = ''): self
             ->setFormType(EaFormRowType::class)
             ->addCssClass('field-form_row')
             ->setFormTypeOptions(['mapped' => false, 'required' => false])
-            ->setCustomOption(self::OPTION_ROW_BREAKPOINT, $breakpointName);
+            ->setCustomOption(self::OPTION_ROW_BREAKPOINT, $breakpointName)
+            ->setValue(true);
     }
 
     /**
@@ -92,7 +94,8 @@ public static function addTab(TranslatableInterface|string $label, ?string $icon
             ->setFormType(EasyAdminTabType::class)
             ->addCssClass('field-form_tab')
             ->setFormTypeOptions(['mapped' => false, 'required' => false])
-            ->setCustomOption(self::OPTION_ICON, $icon);
+            ->setCustomOption(self::OPTION_ICON, $icon)
+            ->setValue(true);
     }
 
     public function setIcon(string $iconCssClass): self


Test patch: