Commit 0f889bca authored by Alexandre Morin's avatar Alexandre Morin
Browse files

Merge branch 'hotfix/2.3.1' into 'master'

Fix : Sending a message without schema

See merge request maarch/thirdPartyArchiving!49
parents 47f30be4 51909e82
......@@ -45,7 +45,7 @@ class ArchiveTransfer extends abstractMessage
*
* @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();
$message = \laabs::newInstance('medona/message');
......@@ -66,6 +66,8 @@ class ArchiveTransfer extends abstractMessage
$this->detectSchema($message);
}
var_dump($message->schema);
exit();
try {
$archiveTransferController = \laabs::newController($message->schema. '/ArchiveTransfer');
$archiveTransferController->receive($message);
......@@ -262,11 +264,11 @@ class ArchiveTransfer extends abstractMessage
}
}
if (!isset($schema)) {
if (empty($schema)) {
$schema = \laabs::resolveXmlNamespace($messageNamespace);
}
if (!isset($schema)) {
if (empty($schema)) {
throw \laabs::newException('medona/invalidMessageException', "Unknown message schema'.$messageNamespace", 400);
}
......
......@@ -74,7 +74,7 @@ interface archiveTransferInterface
*
* @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
......
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