-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
cac:AdditionalDocumentReference/cac:Attachment/cac:ExternalReference can be set, but an error is thrown:
XMLWriter::writeAttribute() expects parameter 2 to be string, null given
Proposed change in Attachment.php:
public function xmlSerialize(Writer $writer): void
{
$this->validate();
if (!empty($this->filePath)) {
$fileContents = base64_encode(file_get_contents($this->filePath));
$fileName = basename($this->filePath);
$mimeType = $this->getFilePathMimeType();
$writer->write([
'name' => Schema::CBC . 'EmbeddedDocumentBinaryObject',
'value' => $fileContents,
'attributes' => [
'mimeCode' => $mimeType,
'filename' => $fileName,
],
]);
} elseif (!empty($this->base64Content)) {
$fileContents = $this->base64Content;
$fileName = $this->fileName;
$mimeType = $this->mimeType;
$writer->write([
'name' => Schema::CBC . 'EmbeddedDocumentBinaryObject',
'value' => $fileContents,
'attributes' => [
'mimeCode' => $mimeType,
'filename' => $fileName,
],
]);
} elseif (!empty($this->externalReference)) {
$writer->writeElement(
Schema::CAC . 'ExternalReference',
[Schema::CBC . 'URI' => $this->externalReference]
);
}
}
Metadata
Metadata
Assignees
Labels
No labels