mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 19:43:16 +00:00
PHRAS-3422 change assetId
This commit is contained in:
@@ -30,6 +30,15 @@ class PSAdminController extends Controller
|
|||||||
if ($form->isValid()) {
|
if ($form->isValid()) {
|
||||||
$app['conf']->set(['phraseanet-service', 'expose-service'], $form->getData());
|
$app['conf']->set(['phraseanet-service', 'expose-service'], $form->getData());
|
||||||
|
|
||||||
|
// generate a uniq key between phraseanet service and the phraseanet instance if not exist
|
||||||
|
if(!$app['conf']->has(['phraseanet-service', 'phraseanet_local_key'])) {
|
||||||
|
$instanceKey = $this->app['conf']->get(['main', 'key']);
|
||||||
|
|
||||||
|
$phraseanetLocalKey = md5($instanceKey);
|
||||||
|
|
||||||
|
$app['conf']->set(['phraseanet-service', 'phraseanet_local_key'], $phraseanetLocalKey);
|
||||||
|
}
|
||||||
|
|
||||||
return $app->redirectPath('ps_admin');
|
return $app->redirectPath('ps_admin');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -126,11 +126,11 @@ class ExposeUploadWorker implements WorkerInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$instanceKey = $this->app['conf']->get(['main', 'key']);
|
$phraseanetLocalKey = $this->app['conf']->get(['phraseanet-service', 'phraseanet_local_key']);
|
||||||
|
|
||||||
// this is the unique reference for record in phraseanet and assets in expose
|
// this is the unique reference for record in phraseanet and assets in expose
|
||||||
// instanceKey_basedID_record_id
|
// phraseanetLocalKey_basedID_record_id
|
||||||
$assetId = $instanceKey.'_'.$record->getId();
|
$assetId = $phraseanetLocalKey.'_'.$record->getId();
|
||||||
|
|
||||||
$requestBody = [
|
$requestBody = [
|
||||||
'publication_id' => $payload['publicationId'],
|
'publication_id' => $payload['publicationId'],
|
||||||
|
Reference in New Issue
Block a user