Skip to content
Snippets Groups Projects
Verified Commit 54c3fc73 authored by Damien's avatar Damien
Browse files

FEAT #14849 TIME 0 Fix update entities + alfresco mapping file

parent 2fbb6ee3
No related branches found
No related tags found
No related merge requests found
......@@ -224,7 +224,7 @@ class EntityController
return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']);
}
$entity = EntityModel::getByEntityId(['entityId' => $aArgs['id'], 'select' => [1]]);
$entity = EntityModel::getByEntityId(['entityId' => $aArgs['id'], 'select' => ['external_id']]);
if (empty($entity)) {
return $response->withStatus(400)->withJson(['errors' => 'Entity not found']);
}
......
......@@ -582,6 +582,10 @@ class AlfrescoController
if ($fileContent === false) {
return ['errors' => 'Document not found on docserver'];
}
$alfrescoParameters = CoreConfigModel::getJsonLoaded(['path' => 'apps/maarch_entreprise/xml/alfresco.json']);
if (empty($alfrescoParameters)) {
return ['errors' => 'Alfresco mapping file does not exist'];
}
$curlResponse = CurlModel::execSimple([
'url' => "{$alfrescoUri}/alfresco/versions/1/nodes/{$args['folderId']}/children",
......@@ -611,7 +615,6 @@ class AlfrescoController
$documentId = $curlResponse['response']['entry']['id'];
$properties = [];
$alfrescoParameters = CoreConfigModel::getJsonLoaded(['path' => 'apps/maarch_entreprise/xml/alfresco.json']);
if (!empty($alfrescoParameters['mapping']['document'])) {
$resourceContacts = ResourceContactModel::get([
'where' => ['res_id = ?', 'mode = ?'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment