I have an entity that describes a task. This task can have children that are assembled via a parent ID. I now try to get a list of all children following a parent. But the code at dpm
is not even reached.
(This is a controller that I created for the purpose of testing that the correct list of children is returned)
public function content(){
echo "attemting to get child";
$entity = \Drupal::entityTypeManager()->getStorage('tasks')->load('11'); //Last breakpoint reached before error
dpm($entity->getChildFollowUps($entity));
}
I get an error
LogicException: The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution. in Drupal\Core\Database\Connection->__sleep() (line 2035 of core/lib/Drupal/Core/Database/Connection.php).
And I fail to understand why this doesn't work. Yes the ID in load(11)
does exist, I checked that in the list view of the entity.