Skip to content

Commit

Permalink
Merge pull request #48 from aligent/fix/suggest_export
Browse files Browse the repository at this point in the history
Fix/suggest export
  • Loading branch information
aligent-lturner authored Nov 15, 2024
2 parents 8809af0 + fdf3ef3 commit 8f73e42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/export/Model/Data/Suggest/SearchTermsFileGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ public function generateFile(string $directory): string
{
$defaultLocale = $this->generalConfig->getDefaultLocale();
$searchTerms = $this->getSearchTerms();
if (empty($searchTerms)) {
return '';
}

$filename = $directory . DIRECTORY_SEPARATOR .
($this->isBlacklist ? self::BLACKLIST_FILENAME : self::WHITELIST_FILENAME);
Expand Down
11 changes: 10 additions & 1 deletion src/export/Model/GenerateSuggestExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,16 @@ public function execute(): void
// create all required files
$files = [];
foreach ($this->fileGenerators as $fileGenerator) {
$files[] = $fileGenerator->generateFile($directory);
$file = $fileGenerator->generateFile($directory);
if (!empty($file)) {
$files[] = $fileGenerator->generateFile($directory);
}
}

// only create the zip file and export entity if there are files to include
if (empty($files)) {
$this->logger->info(__METHOD__ . ': No files to export');
return;
}

// create zip file
Expand Down

0 comments on commit 8f73e42

Please sign in to comment.