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/PocketImport.php | 5 ++++- src/Wallabag/ImportBundle/Import/ReadabilityImport.php | 5 ++++- src/Wallabag/ImportBundle/Import/WallabagImport.php | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 798cfdae..841f829d 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -255,7 +255,10 @@ class PocketImport 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; } 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; } diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php index a1cc085b..9cd3dcb8 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagImport.php +++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php @@ -172,7 +172,10 @@ abstract class WallabagImport 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