Skip to content

Commit

Permalink
fix event EXPORT_CREATE for basket download
Browse files Browse the repository at this point in the history
  • Loading branch information
jygaulier committed Jun 20, 2024
1 parent 7915282 commit 2e4db52
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/Alchemy/Phrasea/Controller/Prod/DownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ public function checkDownload(Request $request)
$list['include_report'] = $request->request->get('include_report') === 'INCLUDE_REPORT';
$list['include_businessfields'] = (bool)$request->request->get('businessfields');

$lst = [];
foreach ($list['files'] as $file) {
$lst[] = $this->getApplicationBox()->get_collection($file['base_id'])->get_databox()->get_sbas_id() . '_' . $file['record_id'];
}
$lst = join(';', $lst);

$token = $this->getTokenManipulator()->createDownloadToken($this->getAuthenticatedUser(), serialize($list));

$this->getDispatcher()->dispatch(PhraseaEvents::EXPORT_CREATE, new ExportEvent(
Expand Down Expand Up @@ -136,6 +142,12 @@ public function listDownloadAsync(Request $request)
$records[sprintf('%s_%s', $sbasId, $file['record_id'])] = $record;
}

$lst = [];
foreach ($list['files'] as $file) {
$lst[] = $this->getApplicationBox()->get_collection($file['base_id'])->get_databox()->get_sbas_id() . '_' . $file['record_id'];
}
$lst = join(';', $lst);

$token = $this->getTokenManipulator()->createDownloadToken($this->getAuthenticatedUser(), serialize($list));

$pusher_auth_key =$this->getConf()->get(['download_async', 'enabled'], false) ? $this->getConf()->get(['externalservice', 'pusher', 'auth_key'], '') : null;
Expand Down

0 comments on commit 2e4db52

Please sign in to comment.