diff -u b/src/Commands/ContentSyncCommands.php b/src/Commands/ContentSyncCommands.php --- b/src/Commands/ContentSyncCommands.php +++ b/src/Commands/ContentSyncCommands.php @@ -336,10 +336,7 @@ } } $context['sandbox']['progress']++; - $context['finished'] = $context['sandbox']['max'] > 0 ? $context['sandbox']['progress'] / $context['sandbox']['max'] : 1; - if ($context['sandbox']['progress'] >= $context['sandbox']['max']) { - $context['finished'] = 1; - } + $context['finished'] = $context['sandbox']['max'] > 0 && $context['sandbox']['progress'] < $context['sandbox']['max'] ? $context['sandbox']['progress'] / $context['sandbox']['max'] : 1; } /** @@ -396,10 +393,7 @@ $context['results']['errors'][] = $context['message']; } - $context['finished'] = $context['sandbox']['max'] > 0 ? $context['sandbox']['progress'] / $context['sandbox']['max'] : 1; - if ($context['sandbox']['progress'] >= $context['sandbox']['max']) { - $context['finished'] = 1; - } + $context['finished'] = $context['sandbox']['max'] > 0 && $context['sandbox']['progress'] < $context['sandbox']['max'] ? $context['sandbox']['progress'] / $context['sandbox']['max'] : 1; } /** diff -u b/src/Form/ContentExportTrait.php b/src/Form/ContentExportTrait.php --- b/src/Form/ContentExportTrait.php +++ b/src/Form/ContentExportTrait.php @@ -56,6 +56,9 @@ * The batch context. */ public function processContentExportFiles($files, $serializer_context, &$context) { + if (!isset($serializer_context['content_sync_directory_file'])) { + $serializer_context['content_sync_directory_file'] = content_sync_get_content_directory('sync'); + } //Initialize Batch if (empty($context['sandbox'])) { $context['sandbox']['progress'] = 0; @@ -85,8 +88,9 @@ $context['results'][] = $name; } $context['sandbox']['progress']++; - if ($context['sandbox']['progress'] != $context['sandbox']['max']) { - $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max']; + $context['finished'] = $context['sandbox']['max'] > 0 && $context['sandbox']['progress'] < $context['sandbox']['max'] ? $context['sandbox']['progress'] / $context['sandbox']['max'] : 1; + if ($context['finished'] == 1 && !empty($serializer_context['content_sync_directory_file']) && file_exists("{$serializer_context['content_sync_directory_file']}/files")) { + $this->getArchiver()->addModify("{$serializer_context['content_sync_directory_file']}/files", '', $serializer_context['content_sync_directory_file']); } }