From f1ebf50be1ad7e44c1373aa54e01bab2f42b24cc Mon Sep 17 00:00:00 2001 From: aynsix Date: Mon, 27 Nov 2023 16:50:17 +0300 Subject: [PATCH] fix --- .../Phrasea/Command/Record/RescanFilesMetadata.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/Alchemy/Phrasea/Command/Record/RescanFilesMetadata.php b/lib/Alchemy/Phrasea/Command/Record/RescanFilesMetadata.php index fb016feb35..b5b7ca609d 100644 --- a/lib/Alchemy/Phrasea/Command/Record/RescanFilesMetadata.php +++ b/lib/Alchemy/Phrasea/Command/Record/RescanFilesMetadata.php @@ -164,10 +164,8 @@ protected function doExecute(InputInterface $input, OutputInterface $output) $action = "set"; if ($field->is_multi()) { - $action = 'add'; - - if ($multi == 'replace') { - $action = 'replace'; + if ($multi != 'replace') { + $action = 'add'; } } @@ -205,9 +203,9 @@ protected function doExecute(InputInterface $input, OutputInterface $output) if ($results != NULL) { $metadatas = []; - if ($action == 'replace') { - // available action when field is multi-value + if ($field->is_multi()) { $metadatas[] = [ + 'action' => $action, 'meta_struct_id' => $metaStructId, 'meta_id' => null, 'value' => $this->sanitizeValue($results, $fieldType)