Skip to content

Commit

Permalink
Adjusting the document data according to the new document type.
Browse files Browse the repository at this point in the history
  • Loading branch information
haogatyp authored and claussni committed Jun 4, 2021
1 parent 391449e commit 2111771
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Classes/Controller/DocumentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,12 @@ public function changeDocumentTypeAction(\EWW\Dpf\Domain\Model\Document $documen
$internalFormat->setDocumentType($documentType->getName());
$document->setXmlData($internalFormat->getXml());

/** @var DocumentMapper $documentMapper */
$documentMapper = $this->objectManager->get(DocumentMapper::class);
// Adjusting the document data according to the new document type
$documentForm = $documentMapper->getDocumentForm($document);
$document = $documentMapper->getDocument($documentForm);

$this->updateDocument($document, '', null);
$this->redirect('showDetails', 'Document', null, ['document' => $document]);
} else {
Expand Down

0 comments on commit 2111771

Please sign in to comment.