Do not cache entities directly in NodesListBuilder but cache only the IDs instead

Otherwise the doctrine proxies break, and we get issues with loading the preview_images in structural Elements.
This commit is contained in:
Jan Böhmer 2023-07-20 23:20:46 +02:00
parent 2e8cb35acc
commit 8ce5f4a796
9 changed files with 173 additions and 25 deletions

View file

@ -92,7 +92,7 @@ class StructuralDBElementRepositoryTest extends WebTestCase
public function testToNodesListRoot(): void
{
//List all root nodes and their children
$nodes = $this->repo->toNodesList();
$nodes = $this->repo->getFlatList();
$this->assertCount(7, $nodes);
$this->assertContainsOnlyInstancesOf(AttachmentType::class, $nodes);
@ -109,7 +109,7 @@ class StructuralDBElementRepositoryTest extends WebTestCase
{
//List all nodes that are children to Node 1
$node1 = $this->repo->find(1);
$nodes = $this->repo->toNodesList($node1);
$nodes = $this->repo->getFlatList($node1);
$this->assertCount(3, $nodes);
$this->assertContainsOnlyInstancesOf(AttachmentType::class, $nodes);