aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r--src/Wallabag/CoreBundle/Controller/TagController.php6
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php
index 623a6146..c5746734 100644
--- a/src/Wallabag/CoreBundle/Controller/TagController.php
+++ b/src/Wallabag/CoreBundle/Controller/TagController.php
@@ -63,10 +63,12 @@ class TagController extends Controller
63 $entry->removeTag($tag); 63 $entry->removeTag($tag);
64 $em = $this->getDoctrine()->getManager(); 64 $em = $this->getDoctrine()->getManager();
65 $em->flush(); 65 $em->flush();
66 if (count($tag->getEntries()) == 0) { 66
67 // remove orphan tag in case no entries are associated to it
68 if (count($tag->getEntries()) === 0) {
67 $em->remove($tag); 69 $em->remove($tag);
70 $em->flush();
68 } 71 }
69 $em->flush();
70 72
71 $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer')); 73 $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
72 74
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index fb97454e..a4b727f4 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -29,7 +29,7 @@ services:
29 arguments: 29 arguments:
30 - "@doctrine" 30 - "@doctrine"
31 31
32 wallabag_core.table_prefix_subscriber: 32 wallabag_core.subscriber.table_prefix:
33 class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber 33 class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber
34 arguments: 34 arguments:
35 - "%database_table_prefix%" 35 - "%database_table_prefix%"