Skip to content

Commit 40a9fad

Browse files
authored
Fix segment assignment on Object/Document - resolves #304 (#305)
1 parent 7ba0714 commit 40a9fad

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Controller/Admin/SegmentAssignmentController.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@
3232
*/
3333
class SegmentAssignmentController extends AdminController
3434
{
35+
public static function getSubscribedServices()
36+
{
37+
$services = parent::getSubscribedServices();
38+
$services[SegmentAssignerInterface::class] = SegmentAssignerInterface::class;
39+
40+
return $services;
41+
}
42+
3543
/**
3644
* @Route("/inheritable-segments")
3745
*
@@ -97,7 +105,7 @@ public function assign(Request $request)
97105
$type = $request->get('type') ?? '';
98106
$breaksInheritance = $request->get('breaksInheritance') === 'true';
99107
$segmentIds = json_decode($request->get('segmentIds'), true) ?? [];
100-
108+
//@TODO inject the service, when BC break allowed
101109
$assigner = $this->get(SegmentAssignerInterface::class);
102110
$success = $assigner->assignById($id, $type, $breaksInheritance, $segmentIds);
103111

0 commit comments

Comments
 (0)