From 58fadbc9df3f8b735c04995919b6cf913ca6a977 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 11 Sep 2016 15:53:16 +0200 Subject: Fix error on EntityManager clear Introduced in the recent 2.5.5 release. Also updated deps. --- src/Wallabag/ImportBundle/Import/ReadabilityImport.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Wallabag/ImportBundle/Import/ReadabilityImport.php') diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php index 37b160c5..7bae647d 100644 --- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php +++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php @@ -169,7 +169,10 @@ class ReadabilityImport extends AbstractImport // flush every 20 entries if (($i % 20) === 0) { $this->em->flush(); - $this->em->clear($entry); + + // clear only affected entities + $this->em->clear(Entry::class); + $this->em->clear(Tag::class); } ++$i; } -- cgit v1.2.3 From 88e88016b9a86d76940082b62c85c3756f461cb2 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 11 Sep 2016 16:30:01 +0200 Subject: Clearing entities in the loop fail on Postgres It looks like when you clear entities on Postgres some references are lost and tags are not saved :-/ --- src/Wallabag/ImportBundle/Import/ReadabilityImport.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/Wallabag/ImportBundle/Import/ReadabilityImport.php') diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php index 7bae647d..c7cfe15d 100644 --- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php +++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php @@ -169,14 +169,11 @@ class ReadabilityImport extends AbstractImport // flush every 20 entries if (($i % 20) === 0) { $this->em->flush(); - - // clear only affected entities - $this->em->clear(Entry::class); - $this->em->clear(Tag::class); } ++$i; } $this->em->flush(); + $this->em->clear(); } } -- cgit v1.2.3