Commit 88b6f5bb authored by Arnaud Pauget's avatar Arnaud Pauget
Browse files

Merge branch 'develop' into 'Support/2.8.X'

fix/20416 transfer validation no profile on Archival Agreement nor

See merge request maarch/archivesPubliques!260
parents 40154313 38e44aa8
# CHANGELOG
## Version 2.8.3
- `Fixed` Erreur lors de l'import d'un bordereau Octave comprenant des namespace dans les balises.
## Version 2.8.2
- `Fixed` Erreur lors de la création d'un DIP en ressortie d'une archive.
- `Fixed` Erreur de vérification du niveau de service déclaré dans un bordereau entrant en fonction de celui déclaré dans l'accord de versement.
......
......@@ -29,6 +29,11 @@ trait OctaveTrait
$xml->load($messagePath);
$xml->xpath = \laabs::newService('dependency/xml/XPath', $xml);
$prefix = $xml->lookupPrefix($xml->documentElement->namespaceURI);
if (!empty($prefix)) {
$prefix .= ':';
}
$xml->xpath->registerNamespace('seda2', $xml->documentElement->namespaceURI);
......@@ -48,7 +53,7 @@ trait OctaveTrait
break;
case 'ArchivalAgreement':
$archivalAgreementText = $xml->createTextNode($paramValue);
$archivalAgreementNode = $xml->createElement('ArchivalAgreement');
$archivalAgreementNode = $xml->createElement($prefix.'ArchivalAgreement');
$archivalAgreementNode->appendChild($archivalAgreementText);
$codeListVersionsNode = $xml->xpath->query("//seda2:CodeListVersions")->item(0);
......@@ -74,7 +79,7 @@ trait OctaveTrait
break;
case 'OriginatingAgencyIdentifier':
$originatingAgencyIdentifierText = $xml->createTextNode($paramValue);
$originatingAgencyIdentifierNode = $xml->createElement('OriginatingAgencyIdentifier');
$originatingAgencyIdentifierNode = $xml->createElement($prefix.'OriginatingAgencyIdentifier');
$originatingAgencyIdentifierNode->appendChild($originatingAgencyIdentifierText);
$logBookNode = $xml->xpath->query("//seda2:ManagementMetadata/seda2:LogBook")->item(0);
......@@ -82,7 +87,7 @@ trait OctaveTrait
$managementMetadataNode->insertBefore($originatingAgencyIdentifierNode, $logBookNode);
if (!is_null($params['ServiceLevel'])) {
$serviceLevelText = $xml->createTextNode($params['ServiceLevel']);
$serviceLevelNode = $xml->createElement('ServiceLevel');
$serviceLevelNode = $xml->createElement($prefix.'ServiceLevel');
$serviceLevelNode->appendChild($serviceLevelText);
$managementMetadataNode->insertBefore($serviceLevelNode, $originatingAgencyIdentifierNode);
}
......
......@@ -48,7 +48,7 @@ trait ArchiveTransferValidationTrait
if ($archivalAgreement->signed && !isset($message->object->signature)) {
$this->sendError("309");
}
if (isset($archivalAgreement->archivalProfileReference)
if (!empty($archivalAgreement->archivalProfileReference)
|| isset($message->object->dataObjectPackage->managementMetadata->archivalProfile->value)) {
$this->validateProfile($this->message, $archivalAgreement);
}
......
......@@ -39,7 +39,7 @@
SetEnv LAABS_LOG "../data/maarchRM/log.txt"
SetEnv LAABS_TMP_DIR "../data/maarchRM/tmp"
SetEnv LAABS_CONTENT_TYPES "url:application/x-www-form-urlencoded;html:text/html,application/xhtml+xml;xml:application/xml;json:application/json,application/javascript;soap:application/soap+xml;csv:text/csv"
SetEnv LAABS_CONTENT_TYPES "url:application/x-www-form-urlencoded,multipart/form-data;html:text/html,application/xhtml+xml;xml:application/xml;json:application/json,application/javascript;soap:application/soap+xml;csv:text/csv"
#SetEnv LAABS_CONTENT_LANGUAGES "fr:fr,fr-fr,fr-ca"
SetEnv LAABS_CACHE_CONTROL "public, max-age=3600"
......@@ -73,4 +73,4 @@
# </If>
# </Directory>
</VirtualHost>
\ No newline at end of file
</VirtualHost>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment