Skip to content

Commit

Permalink
Fix problem with rendering block by type
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszWojdalowicz committed Mar 7, 2024
1 parent e9911d9 commit 88c4bf4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Twig/Runtime/SuluRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ public function renderSuluBlocksWithType(array $blocks, string $type, ?string $d

public function renderSuluBlockWithType(array $blocks, string $type): string
{
$blocks = array_filter($blocks, fn (array $block) => $block['type'] === $type);
if (count($blocks) > 1) {
$blocks = $blocks[0];
$blocks = array_values(array_filter($blocks, fn (array $block) => $block['type'] === $type));

if (0 === count($blocks)) {
return '';
}

$content = '';
$block = $blocks[0];

foreach ($blocks as $block) {
$content .= $this->blockRendererStrategy->renderBlock($block);
}
$content = '';
$content .= $this->blockRendererStrategy->renderBlock($block) ?? '';

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony 5.4.*, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony 5.4.*, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony ^6.0, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony ^6.0, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony ^6.0, MySQL 5.7

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony 5.4.*, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony 5.4.*, MySQL 5.7

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony ^6.0, MySQL 5.7

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony ^6.0, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony ^6.0, MySQL 5.7

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony ^6.0, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony 5.4.*, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony 5.4.*, MySQL 5.7

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony 5.4.*, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony ^6.0, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony 5.4.*, MySQL 5.7

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony ^6.0, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony 5.4.*, MySQL 5.7

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony ^6.0, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony ^6.0, MySQL 5.7

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony ^6.0, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony 5.4.*, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony ^6.0, MySQL 5.7

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony 5.4.*, MySQL 5.7

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony ^6.0, MySQL 5.7

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.1, Symfony 5.4.*, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony 5.4.*, MySQL 8.0

Expression on left side of ?? is not nullable.

Check failure on line 76 in src/Twig/Runtime/SuluRuntime.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12.13, PHP 8.0, Symfony 5.4.*, MySQL 5.7

Expression on left side of ?? is not nullable.

return $content;
}
Expand Down

0 comments on commit 88c4bf4

Please sign in to comment.