@@ -25,10 +25,12 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
2525
2626 $ params = $ request ->getQueryParams ();
2727 $ overrideValues = json_decode ($ params ['overrideValues ' ] ?? '[] ' , true , 512 , JSON_THROW_ON_ERROR );
28+ $ overrideValues = array_map (static fn ($ value ): int => (int )$ value , $ overrideValues );
29+ $ recordTypeValue = $ params ['recordTypeValue ' ] ?? '' ;
2830 $ command = $ params ['command ' ] ?? '' ;
2931
3032 // make sure it is the right request
31- if (empty ( $ overrideValues ) || $ command !== 'new ' ) {
33+ if ($ recordTypeValue !== ' tx-ximatypo3recordlist-filter ' || $ command !== 'new ' ) {
3234 return $ handler ->handle ($ request );
3335 }
3436
@@ -37,10 +39,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
3739 $ response = $ handler ->handle ($ request );
3840 $ treeData = json_decode ($ response ->getBody ()->getContents (), true , 512 , JSON_THROW_ON_ERROR );
3941 foreach ($ treeData as &$ treeItem ) {
40- if (!in_array ((int )$ treeItem ['identifier ' ], $ overrideValues , true )) {
41- continue ;
42- }
43- $ treeItem ['checked ' ] = true ;
42+ $ treeItem ['checked ' ] = in_array ((int )$ treeItem ['identifier ' ], $ overrideValues , true );
4443 }
4544 return new JsonResponse ($ treeData );
4645 } catch (\Exception ) {
0 commit comments