Skip to content

Commit

Permalink
fix crash when nothing to do on a record
Browse files Browse the repository at this point in the history
  • Loading branch information
jygaulier authored Sep 27, 2023
1 parent b839efd commit 78a36ae
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/Alchemy/Phrasea/Command/Thesaurus/Translator/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +480,17 @@ private function doRecord($record_id, $metas)
}
}

$jsActions = json_encode($actions, JSON_PRETTY_PRINT);
if($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE) {
$this->output->writeln(sprintf("<info>JS : %s</info>", $jsActions));
}

if (!$this->globalConfiguration->isDryRun()) {
$record = $this->getDatabox()->getRecordRepository()->find($record_id);
$record->setMetadatasByActions(json_decode($jsActions));
if(count($actions) > 0) {
$jsActions = json_encode($actions, JSON_PRETTY_PRINT);
if($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE) {
$this->output->writeln(sprintf("<info>JS : %s</info>", $jsActions));
}

if (!$this->globalConfiguration->isDryRun()) {
$record = $this->getDatabox()->getRecordRepository()->find($record_id);
$record->setMetadatasByActions(json_decode($jsActions));
}
}

$this->recordsDone++;
}

Expand Down

0 comments on commit 78a36ae

Please sign in to comment.