From 2ac08d225fb9ba29da91e0162abfd13882705689 Mon Sep 17 00:00:00 2001 From: Jean-Yves Gaulier Date: Mon, 5 Oct 2015 15:36:17 +0200 Subject: [PATCH 1/2] #PHRAS-741 #time 10m fix event/es --- .../Phrasea/SearchEngine/Phrasea/PhraseaEngineSubscriber.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineSubscriber.php b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineSubscriber.php index f0579814ac..0d0d39eda8 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineSubscriber.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineSubscriber.php @@ -12,7 +12,7 @@ namespace Alchemy\Phrasea\SearchEngine\Phrasea; use Alchemy\Phrasea\Application; -use Alchemy\Phrasea\Core\Event\CollectionCreateEvent; +use Alchemy\Phrasea\Core\Event\CollectionCreated; use Alchemy\Phrasea\Core\Event\PostAuthenticate; use Alchemy\Phrasea\Core\PhraseaEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -31,7 +31,7 @@ class PhraseaEngineSubscriber implements EventSubscriberInterface $event->getUser()->ACL()->inject_rights(); } - public function onCollectionCreate(CollectionCreateEvent $event) + public function onCollectionCreate(CollectionCreated $event) { $sql = 'SELECT u.usr_id, c.session_id FROM (usr u, Sessions s, basusr b) From ce6e42e9b48ccb3337452ddac6d0adb80f8879f0 Mon Sep 17 00:00:00 2001 From: Jean-Yves Gaulier Date: Mon, 5 Oct 2015 17:13:41 +0200 Subject: [PATCH 2/2] #PHRAS-741 #time 15m added 2 events --- lib/Alchemy/Phrasea/Command/Command.php | 8 ++++++++ lib/Alchemy/Phrasea/Core/Event/CollectionUnmounted.php | 4 ++-- lib/classes/collection.php | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/Alchemy/Phrasea/Command/Command.php b/lib/Alchemy/Phrasea/Command/Command.php index afdd7f9d88..76a5bd6334 100644 --- a/lib/Alchemy/Phrasea/Command/Command.php +++ b/lib/Alchemy/Phrasea/Command/Command.php @@ -52,6 +52,14 @@ abstract class Command extends SymfoCommand implements CommandInterface return $logger; }) ); + + $this->container['dispatcher'] = $this->container->share( + $this->container->extend('dispatcher', function ($dispatcher, Application $app) { + $dispatcher->addSubscriber($app['phraseanet.bo-events-subscriber']); + + return $dispatcher; + }) + ); } return $this->doExecute($input, $output); diff --git a/lib/Alchemy/Phrasea/Core/Event/CollectionUnmounted.php b/lib/Alchemy/Phrasea/Core/Event/CollectionUnmounted.php index f96535b242..2d043e760c 100644 --- a/lib/Alchemy/Phrasea/Core/Event/CollectionUnmounted.php +++ b/lib/Alchemy/Phrasea/Core/Event/CollectionUnmounted.php @@ -11,8 +11,8 @@ class CollectionUnmounted extends CollectionRelated return $this->args['coll_id']; } - public function getName() + public function getCollName() { - return $this->args['name']; + return $this->args['coll_name']; } } diff --git a/lib/classes/collection.php b/lib/classes/collection.php index 2de90959fd..17b8629284 100644 --- a/lib/classes/collection.php +++ b/lib/classes/collection.php @@ -625,7 +625,7 @@ class collection implements cache_cacheableInterface null, // the coll is not available anymore array( 'coll_id'=>$old_coll_id, - 'name'=>$old_name + 'coll_name'=>$old_name ) ) );