{"issue":{"created_at":"2011-11-22T09:16:24Z","state":"open","updated_at":"2011-11-24T14:04:47Z","user":{"gravatar_id":"1730ceaee334de1c0859c3667e229480","id":124412,"url":"https://api.github.com/users/luscarpa","login":"luscarpa","avatar_url":"https://secure.gravatar.com/avatar/1730ceaee334de1c0859c3667e229480?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":4,"body":"I have a problem with TreeSlugHandler and Translatable. Here a small example:\r\n\r\n        $food = new \\App\\Entity\\Category();\r\n        $food->setName('Food');\r\n        $food->setTranslatableLocale('it_IT');\r\n        \r\n        $fruits = new \\App\\Entity\\Category();\r\n        $fruits->setName('Fruits');\r\n        $fruits->setParent($food);\r\n        $fruits->setTranslatableLocale('it_IT');\r\n        \r\n        $vegetables = new \\App\\Entity\\Category();\r\n        $vegetables->setName('Vegetables');\r\n        $vegetables->setParent($food);\r\n        $vegetables->setTranslatableLocale('it_IT');\r\n        \r\n        $carrots = new \\App\\Entity\\Category();\r\n        $carrots->setName('Carrots');\r\n        $carrots->setParent($vegetables);\r\n        $carrots->setTranslatableLocale('it_IT');\r\n        \r\n        $this->_em->persist($food);\r\n        $this->_em->persist($fruits);\r\n        $this->_em->persist($vegetables);\r\n        $this->_em->persist($carrots);\r\n        $this->_em->flush()\r\n\r\nWith these settings I have the following slug: \r\n\r\n        food\r\n        food/fruits\r\n        food/vegetables\r\n        food/vegetables/carrots\r\n\r\nNow, if I change food entry into 'Food New' with this code:\r\n\r\n        $category = $this->_em->getRepository('\\App\\Entity\\Category')->findOneByName('Food');\r\n        $category->setName('Food New');\r\n        \r\n        $this->_em->persist($category);\r\n        $this->_em->flush();\r\n\r\nI get the right result:\r\n\r\n        food-new\r\n        food-new/fruits\r\n        food-new/vegetables\r\n        food-new/vegetables/carrots\r\n\r\nBut if I want to change also the italian translation\r\n\r\n        $category = $this->_em->getRepository('\\App\\Entity\\Category')->findOneByName('Food');\r\n        $category->setName('Cibo');\r\n        $category->setTranslatableLocale('it_it');\r\n        \r\n        $this->_em->persist($category);\r\n        $this->_em->flush();\r\n\r\nI get this result that is wrong\r\n\r\n        cibo\r\n        food/fruits\r\n        food/vegetables\r\n        food/vegetables/carrots\r\n\r\nMoreover if I change the category that is on the second level:\r\n\r\n        $category = $this->_em->getRepository('\\App\\Entity\\Category')->findOneByName('Vegetables');\r\n        $category->setName('Ortaggi');\r\n        $category->setTranslatableLocale('it_it');\r\n        \r\n        $this->_em->persist($category);\r\n        $this->_em->flush();\r\n\r\nI get this\r\n\r\n        cibo\r\n        food/fruits\r\n        food-new/ortaggi\r\n        food/vegetables/carrots\r\n\r\nI'm doing something wrong or there is a bug? \r\n","assignee":null,"id":2315898,"number":194,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[],"title":"TreeSlugHandler + Translatable","closed_at":null,"html_url":"https://github.com/l3pp4rd/DoctrineExtensions/issues/194","milestone":null,"url":"https://api.github.com/repos/l3pp4rd/DoctrineExtensions/issues/194"},"action":"created","comment":{"created_at":"2011-11-24T14:04:47Z","updated_at":"2011-11-24T14:04:47Z","user":{"gravatar_id":"1730ceaee334de1c0859c3667e229480","id":124412,"url":"https://api.github.com/users/luscarpa","login":"luscarpa","avatar_url":"https://secure.gravatar.com/avatar/1730ceaee334de1c0859c3667e229480?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"After some tests I have seen that the big problem is in SluggableListener that is invoke only onFlush, but many operations are done directly from NestedTreeRepository, like removeFromTree, without call flush. Do you have an idea how we can invoke SluggableListener? I think that there is the same problem for TranslationListener.","id":2864792,"url":"https://api.github.com/repos/l3pp4rd/DoctrineExtensions/issues/comments/2864792"}}