Skip to content

Commit

Permalink
fix: [console:event-shell] Fixed regression on events/export for many…
Browse files Browse the repository at this point in the history
… format

- Fixes MISP#10202
- Correctly fallback MispAttribute model instead of Attribute
  • Loading branch information
mokaddem committed Feb 3, 2025
1 parent 6558167 commit 12b7d4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Console/Command/EventShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ public function cache()
private function __runCaching($user, $typeData, $id, $export_type, $subType = '')
{
$export_type = strtolower($typeData['type']);
$final = $this->{$typeData['scope']}->restSearch($user, $typeData['params']['returnFormat'], $typeData['params'], false, $id);
$modelScope = $typeData['scope'] == 'Attribute' ? 'MispAttribute' : $typeData['scope'];
$final = $this->{$modelScope}->restSearch($user, $typeData['params']['returnFormat'], $typeData['params'], false, $id);
$dir = new Folder(APP . 'tmp/cached_exports/' . $export_type, true, 0750);
//echo PHP_EOL . $dir->pwd() . DS . 'misp.' . $export_type . $subType . '.ADMIN' . $typeData['extension'] . PHP_EOL;
if ($user['Role']['perm_site_admin']) {
Expand Down

0 comments on commit 12b7d4d

Please sign in to comment.