You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After 3 days working arround this problem there is some informations that could be useful for people in the same configuration.
I had the error "Properties XXXX does not exist" when I try to display datatable for some entities only.
In fact the problem occur only if there is a relation between the entity you want to display and a FosUser entity, even if you don't display any field of the user entity.
And the problem occur Only if the connected user is related with one of entities.
If your connected user is not related to company entity (for exemple) all is working perfect, as soon as you add the connected user to one company, you ar not able to display datatable and you get the message "Properties XXXX does not exist" .
it's look like there is a incompatibility with the proxy.objects used by FOSUserBundle et AliDatatble in DoctrineBuilder.php
there is my actual composer version, I have already try with the latest ones with the same results
"friendsofsymfony/user-bundle": "v2.0.0-alpha3",
"ali/datatable": "2.1.0",
The text was updated successfully, but these errors were encountered:
in fact the Doctrine builder don't manage correctly the proxy Objects and the reflectionClass.
If you try to use ReflexionClass on a proxy object you are not able to get proporties of the main object.
so there is a way to make it works by retreiving the real class of a proxyobject before get his properies
if (isset($object)){
$ref_class = new \ReflectionClass($object);
if (property_exists($ref_class, $prop) or property_exists($object,$prop) ){
$property = $ref_class->getProperty($prop);
$property->setAccessible(true);
return $property->getValue($object);
}
else {
$realClass = \Doctrine\Common\Util\ClassUtils::getRealClass(get_class($object));
$property = (new \ReflectionClass($realClass))->getProperty($prop);
$property->setAccessible(true);
return $property->getValue($object);
}
}
After 3 days working arround this problem there is some informations that could be useful for people in the same configuration.
I had the error "Properties XXXX does not exist" when I try to display datatable for some entities only.
In fact the problem occur only if there is a relation between the entity you want to display and a FosUser entity, even if you don't display any field of the user entity.
And the problem occur Only if the connected user is related with one of entities.
If your connected user is not related to company entity (for exemple) all is working perfect, as soon as you add the connected user to one company, you ar not able to display datatable and you get the message "Properties XXXX does not exist" .
it's look like there is a incompatibility with the proxy.objects used by FOSUserBundle et AliDatatble in DoctrineBuilder.php
there is my actual composer version, I have already try with the latest ones with the same results
"friendsofsymfony/user-bundle": "v2.0.0-alpha3",
"ali/datatable": "2.1.0",
The text was updated successfully, but these errors were encountered: