Skip to content

Commit

Permalink
Merge 4.x into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Nov 21, 2023
2 parents 25909da + 6606924 commit e472f76
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"psalm/plugin-phpunit": "^0.18",
"psalm/plugin-symfony": "^5.0",
"rector/rector": "^0.18",
"sonata-project/admin-bundle": "^4.9",
"sonata-project/admin-bundle": "^4.28",
"sonata-project/block-bundle": "^4.11 || ^5.0",
"sonata-project/classification-bundle": "^4.0",
"sonata-project/doctrine-orm-admin-bundle": "^4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/GalleryAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function listAction(Request $request): Response
$exportFormats = $exporter->getAvailableFormats($this->admin);
}

return $this->renderWithExtraParams($this->admin->getTemplateRegistry()->getTemplate('list'), [
return $this->render($this->admin->getTemplateRegistry()->getTemplate('list'), [
'action' => 'list',
'form' => $formView,
'datagrid' => $datagrid,
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/MediaAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function createAction(Request $request): Response
$pool = $this->container->get('sonata.media.pool');
\assert($pool instanceof Pool);

return $this->renderWithExtraParams('@SonataMedia/MediaAdmin/select_provider.html.twig', [
return $this->render('@SonataMedia/MediaAdmin/select_provider.html.twig', [
'providers' => $pool->getProvidersByContext(
$request->query->get('context', $pool->getDefaultContext())
),
Expand Down Expand Up @@ -128,7 +128,7 @@ public function listAction(Request $request): Response
$exportFormats = $exporter->getAvailableFormats($this->admin);
}

return $this->renderWithExtraParams($this->admin->getTemplateRegistry()->getTemplate('list'), [
return $this->render($this->admin->getTemplateRegistry()->getTemplate('list'), [
'action' => 'list',
'form' => $formView,
'datagrid' => $datagrid,
Expand Down
6 changes: 3 additions & 3 deletions src/Model/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ abstract class Media implements MediaInterface, \Stringable

protected ?int $height = null;

protected ?float $length = null;
protected ?string $length = null;

protected ?string $copyright = null;

Expand Down Expand Up @@ -184,12 +184,12 @@ public function getHeight(): ?int

public function setLength(?float $length): void
{
$this->length = $length;
$this->length = null !== $length ? (string) $length : null;
}

public function getLength(): ?float
{
return $this->length;
return null !== $this->length ? (float) $this->length : null;
}

public function setCopyright(?string $copyright): void
Expand Down
2 changes: 1 addition & 1 deletion src/Provider/ImageProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function getHelperProperties(MediaInterface $media, string $format, array
}

unset($options['picture']);
$pictureParams['img'] = $params + $options;
$pictureParams['img'] = array_merge($params, $options);
$params = ['picture' => $pictureParams];
} elseif (MediaProviderInterface::FORMAT_ADMIN !== $format) {
$srcSetFormats = $this->getFormats();
Expand Down

0 comments on commit e472f76

Please sign in to comment.