Skip to content

Commit

Permalink
Bug - Removed do-not-use alias for exporter service
Browse files Browse the repository at this point in the history
  • Loading branch information
eerison committed Apr 29, 2021
1 parent d471f78 commit b7d6261
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Controller/CRUDController.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function listAction()
'form' => $formView,
'datagrid' => $datagrid,
'csrf_token' => $this->getCsrfToken('sonata.batch'),
'export_formats' => $this->has('sonata.admin.admin_exporter') ?
'export_formats' => $this->has('sonata.admin.admin_exporter.do-not-use') ?
$this->get('sonata.admin.admin_exporter.do-not-use')->getAvailableFormats($this->admin) :
$this->admin->getExportFormats(),
]);
Expand Down Expand Up @@ -940,7 +940,7 @@ public function exportAction(Request $request)
$format = $request->get('format');

// NEXT_MAJOR: remove the check
if (!$this->has('sonata.admin.admin_exporter')) {
if (!$this->has('sonata.admin.admin_exporter.do-not-use')) {
@trigger_error(
'Not registering the exporter bundle is deprecated since version 3.14. You must register it to be able to use the export action in 4.0.',
\E_USER_DEPRECATED
Expand All @@ -954,7 +954,7 @@ public function exportAction(Request $request)
date('Y_m_d_H_i_s', strtotime('now')),
$format
);
$exporter = $this->get('sonata.admin.exporter.do-not-use');
$exporter = $this->get('sonata.admin.exporter');
} else {
$adminExporter = $this->get('sonata.admin.admin_exporter.do-not-use');
$allowedExportFormats = $adminExporter->getAvailableFormats($this->admin);
Expand Down
2 changes: 1 addition & 1 deletion tests/Controller/CRUDControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ protected function setUp(): void
$this->container->set('templating', $templating);
$this->container->set('twig', $twig);
$this->container->set('session', $this->session);
$this->container->set('sonata.admin.exporter.do-not-use', $exporter);
$this->container->set('sonata.admin.exporter', $exporter);
$this->container->set('sonata.admin.audit.manager.do-not-use', $this->auditManager);
$this->container->set('sonata.admin.object.manipulator.acl.admin.do-not-use', $this->adminObjectAclManipulator);
$this->container->set('security.csrf.token_manager', $this->csrfProvider);
Expand Down

0 comments on commit b7d6261

Please sign in to comment.