Skip to content

Commit

Permalink
EZP-31113: AssignSectionToSubtree event is not handled by search and …
Browse files Browse the repository at this point in the history
…HTTP cache
  • Loading branch information
adamwojs committed Feb 4, 2020
1 parent 8605b24 commit aaf7047
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use eZ\Publish\API\Repository\Events\Location\SwapLocationEvent;
use eZ\Publish\API\Repository\Events\Location\UnhideLocationEvent;
use eZ\Publish\API\Repository\Events\Location\UpdateLocationEvent;
use eZ\Publish\API\Repository\Events\Section\AssignSectionToSubtreeEvent;
use eZ\Publish\API\Repository\Values\Content\Location;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

Expand All @@ -22,6 +23,7 @@ class LocationEventSubscriber extends AbstractSearchEventSubscriber implements E
public static function getSubscribedEvents(): array
{
return [
AssignSectionToSubtreeEvent::class => 'onAssignSectionToSubtree',
CopySubtreeEvent::class => 'onCopySubtree',
CreateLocationEvent::class => 'onCreateLocation',
DeleteLocationEvent::class => 'onDeleteLocation',
Expand Down Expand Up @@ -117,4 +119,9 @@ public function onUpdateLocation(UpdateLocationEvent $event)
)
);
}

public function onAssignSectionToSubtree(AssignSectionToSubtreeEvent $event): void
{
$this->indexSubtree($event->getLocation()->id);
}
}

0 comments on commit aaf7047

Please sign in to comment.