Commit 3c0a7f1c authored by Alexandre Morin's avatar Alexandre Morin
Browse files

Merge branch 'hotfix/2.3.1' into 'develop'

Hotfix/2.3.1

See merge request maarch/thirdPartyArchiving!48
parents 05493fb4 51909e82
...@@ -45,7 +45,7 @@ class ArchiveTransfer extends abstractMessage ...@@ -45,7 +45,7 @@ class ArchiveTransfer extends abstractMessage
* *
* @todo Remove files from sas when error on reception * @todo Remove files from sas when error on reception
*/ */
public function receive($messageFile, $attachments = array(), $schema = false, $filename = false) public function receive($messageFile, $attachments = array(), $schema = null, $filename = false)
{ {
$messageId = \laabs::newId(); $messageId = \laabs::newId();
$message = \laabs::newInstance('medona/message'); $message = \laabs::newInstance('medona/message');
...@@ -66,6 +66,8 @@ class ArchiveTransfer extends abstractMessage ...@@ -66,6 +66,8 @@ class ArchiveTransfer extends abstractMessage
$this->detectSchema($message); $this->detectSchema($message);
} }
var_dump($message->schema);
exit();
try { try {
$archiveTransferController = \laabs::newController($message->schema. '/ArchiveTransfer'); $archiveTransferController = \laabs::newController($message->schema. '/ArchiveTransfer');
$archiveTransferController->receive($message); $archiveTransferController->receive($message);
...@@ -262,11 +264,11 @@ class ArchiveTransfer extends abstractMessage ...@@ -262,11 +264,11 @@ class ArchiveTransfer extends abstractMessage
} }
} }
if (!isset($schema)) { if (empty($schema)) {
$schema = \laabs::resolveXmlNamespace($messageNamespace); $schema = \laabs::resolveXmlNamespace($messageNamespace);
} }
if (!isset($schema)) { if (empty($schema)) {
throw \laabs::newException('medona/invalidMessageException', "Unknown message schema'.$messageNamespace", 400); throw \laabs::newException('medona/invalidMessageException', "Unknown message schema'.$messageNamespace", 400);
} }
......
...@@ -74,7 +74,7 @@ interface archiveTransferInterface ...@@ -74,7 +74,7 @@ interface archiveTransferInterface
* *
* @action medona/ArchiveTransfer/receive * @action medona/ArchiveTransfer/receive
*/ */
public function create($messageFile, $attachments = array(), $schema = false, $filename = null); public function create($messageFile, $attachments = array(), $schema = null, $filename = null);
/** /**
* Validate messages against schema and rules * Validate messages against schema and rules
......
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