We encountered an issue with PDF metadata extraction in the metadata extension.
The error occurs in:
Classes/Index/PdfMetadataExtractor.php
Error message:
Argument 1 passed to Fab\Metadata\Utility\UnicodeUtility::convert()
must be of the type string, null given
The problematic line is:
$value = $this->getUnicodeUtility()->convert($value);
While debugging, we found that some PDFs contain an optional metadata field:
["Trapped"] => NULL
The extension iterates over all PDF properties and passes values directly into convert(), but null values are not handled.
Suggested fix:
$value = $this->getUnicodeUtility()->convert($value ?? '');
This seems to affect PDFs where optional metadata fields are unset/null, which is valid according to the PDF specification.
Environment:
TYPO3 9.5.5
PHP 7.4
We encountered an issue with PDF metadata extraction in the metadata extension.
The error occurs in:
Classes/Index/PdfMetadataExtractor.php
Error message:
Argument 1 passed to Fab\Metadata\Utility\UnicodeUtility::convert()
must be of the type string, null given
The problematic line is:
$value = $this->getUnicodeUtility()->convert($value);
While debugging, we found that some PDFs contain an optional metadata field:
["Trapped"] => NULL
The extension iterates over all PDF properties and passes values directly into convert(), but null values are not handled.
Suggested fix:
$value = $this->getUnicodeUtility()->convert($value ?? '');
This seems to affect PDFs where optional metadata fields are unset/null, which is valid according to the PDF specification.
Environment:
TYPO3 9.5.5
PHP 7.4