Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to this project will be documented in this file.

## [3.10.1] - 2026-02-10
- Fixed: exception in FormatterUtil when value is null

## [3.10.0] - 2026-01-22
- Added: Option to adjust the field where the alias is generated from (instead of overriding the complete method) ([#106](https://github.com/heimrichhannot/contao-utils-bundle/pull/106))
- Added: AliasFieldConfiguration::setGenerateAliasCallback() ([#106](https://github.com/heimrichhannot/contao-utils-bundle/pull/106))
Expand Down
2 changes: 1 addition & 1 deletion src/EntityFinder/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function __construct(
public readonly int $id,
public readonly string $table,
public readonly ?string $description = null,
public readonly ?iterable $parents = null
public readonly iterable|null $parents = null
)
{
}
Expand Down
9 changes: 6 additions & 3 deletions src/Util/FormatterUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,12 @@ public function formatDcaFieldValue(
: $reference;
}

if ($settings->replaceInsertTags)
{
$value = $this->insertTagParser->replace($value);
if (is_int($value) || null === $value) {
return $value;
}

if ($settings->replaceInsertTags) {
$value = $this->insertTagParser->replace((string)$value);
}

return Str::specialchars($value);
Expand Down
11 changes: 11 additions & 0 deletions tests/Util/FormatterUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,16 @@ public function testFormatDcaFieldValue()
->setDcaOverride(['inputType' => 'text'])
)
);

$this->assertEquals(
'',
$formatterUtil->formatDcaFieldValue(
$dataContainer,
'message',
null,
FormatterUtil\FormatDcaFieldValueOptions::create()
->setDcaOverride(['inputType' => 'textarea'])
)
);
}
}