Skip to content

Commit

Permalink
fix[Farmservice] : instantiate symlinked_files as an empty array if null
Browse files Browse the repository at this point in the history
  • Loading branch information
mrflos committed Nov 10, 2023
1 parent 73c77c7 commit dd336f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion services/FarmService.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ public function initFarmConfig()
}
}

if (is_null($this->wiki->config['yeswiki_symlinked_files'])) {
$this->wiki->config['yeswiki_symlinked_files'] = [];
}

if (!isset($this->wiki->config['yeswiki-farm-bg-img'])) {
$this->wiki->config['yeswiki-farm-bg-img'] = '';
}
Expand Down Expand Up @@ -328,7 +332,7 @@ public function createWikiFromEntry($entry, $fieldName)
// create root folder and empty folders
foreach ($this->wiki->config['yeswiki_empty_folders'] as $folder) {
// mise a jour des fichier de YesWiki qui ne sont pas des symlink
if (!in_array($folder, $this->wiki->config['yeswiki_symlinked_files'])) {
if (!empty($this->wiki->config['yeswiki_symlinked_files']) && !in_array($folder, $this->wiki->config['yeswiki_symlinked_files'])) {
mkdir($destfolder.$folder, 0777, true);
}
}
Expand Down

0 comments on commit dd336f9

Please sign in to comment.