Skip to content

Commit

Permalink
Solve deprecations (#1724)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored Nov 21, 2023
1 parent b157db7 commit eaeaf8c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"cocur/slugify": "^4.0",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/persistence": "^3.0.2",
"sonata-project/admin-bundle": "^4.19",
"sonata-project/admin-bundle": "^4.28",
"sonata-project/block-bundle": "^4.18 || ^5.0",
"sonata-project/doctrine-extensions": "^1.18 || ^2.1",
"sonata-project/doctrine-orm-admin-bundle": "^4.0",
Expand Down
6 changes: 2 additions & 4 deletions src/Controller/BlockAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ public function createAction(Request $request): Response
unset($blockServices[$code]);
}

return $this->renderWithExtraParams('@SonataPage/BlockAdmin/select_type.html.twig', [
return $this->render('@SonataPage/BlockAdmin/select_type.html.twig', [
'blockServices' => $blockServices,
'base_template' => $this->getBaseTemplate(),
'admin' => $this->admin,
'action' => 'create',
]);
}
Expand Down Expand Up @@ -171,7 +169,7 @@ public function composePreviewAction(Request $request): Response
\assert($blockManager instanceof BlockServiceManagerInterface);
$blockService = $blockManager->get($existingObject);

return $this->renderWithExtraParams('@SonataPage/BlockAdmin/compose_preview.html.twig', [
return $this->render('@SonataPage/BlockAdmin/compose_preview.html.twig', [
'container' => $container,
'child' => $existingObject,
'blockService' => $blockService,
Expand Down
8 changes: 4 additions & 4 deletions src/Controller/PageAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function treeAction(Request $request): Response
$theme = $this->admin->getFilterTheme();
$this->setFormTheme($formView, $theme);

return $this->renderWithExtraParams($this->admin->getTemplateRegistry()->getTemplate('tree'), [
return $this->render($this->admin->getTemplateRegistry()->getTemplate('tree'), [
'action' => 'tree',
'sites' => $sites,
'currentSite' => $currentSite,
Expand Down Expand Up @@ -153,7 +153,7 @@ public function createAction(Request $request): Response
$current = false;
}

return $this->renderWithExtraParams($this->admin->getTemplateRegistry()->getTemplate('select_site'), [
return $this->render($this->admin->getTemplateRegistry()->getTemplate('select_site'), [
'sites' => $sites,
'current' => $current,
]);
Expand Down Expand Up @@ -237,7 +237,7 @@ public function composeAction(Request $request): Response
}
}

return $this->renderWithExtraParams($this->admin->getTemplateRegistry()->getTemplate('compose'), [
return $this->render($this->admin->getTemplateRegistry()->getTemplate('compose'), [
'object' => $page,
'action' => 'edit',
'template' => $template,
Expand Down Expand Up @@ -314,7 +314,7 @@ public function composeContainerShowAction(Request $request): Response
}
}

return $this->renderWithExtraParams($this->admin->getTemplateRegistry()->getTemplate('compose_container_show'), [
return $this->render($this->admin->getTemplateRegistry()->getTemplate('compose_container_show'), [
'blockServices' => $blockServices,
'blockAdmin' => $blockAdmin,
'container' => $block,
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/SiteAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function snapshotsAction(Request $request): Response
return new RedirectResponse($this->admin->generateUrl('edit', ['id' => $object->getId()]));
}

return $this->renderWithExtraParams('@SonataPage/SiteAdmin/create_snapshots.html.twig', [
return $this->render('@SonataPage/SiteAdmin/create_snapshots.html.twig', [
'action' => 'snapshots',
'object' => $object,
]);
Expand Down

0 comments on commit eaeaf8c

Please sign in to comment.