Skip to content

Commit

Permalink
Fix Filesource
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Sep 1, 2025
1 parent 25b3e17 commit 5e11ec3
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

namespace FileConnector\Model\Table;

use App\Model\Entity\ExternalIdentitySource;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\ORM\TableRegistry;
Expand Down Expand Up @@ -389,16 +390,16 @@ protected function processChangeList(
];
}

/**
* Perform tasks following a Sync Job.
*
* @since COmanage Registry v5.2.0
* @param ExternalIdentitySource $source External Identity Source
*/
/**
* Perform tasks following a Sync Job.
*
* @param ExternalIdentitySource $source External Identity Source
* @since COmanage Registry v5.2.0
*/

public function postRunTasks(
\App\Model\Entity\ExternalIdentitySource $source
) {
): void {
// Update the archive file. updateCache() is called after processing is complete,
// and only if at least one record changed. It's possible an irregular exit will
// prevent the cache from being updated, in that case we'll just end up reprocessing
Expand All @@ -410,7 +411,7 @@ public function postRunTasks(
return;
}

if(is_readable($this->archive1)) {
if($this->archive1 !== null && is_readable($this->archive1)) {
$this->llog('trace', 'Copying ' . $this->archive1 . ' to ' . $this->archive2);

if(!copy($this->archive1, $this->archive2)) {
Expand All @@ -420,7 +421,11 @@ public function postRunTasks(
}
}

if(is_readable($source->file_source->filename)) {
if(
$source->file_source->filename !== null
&& $this->archive1 !== null
&& is_readable($source->file_source->filename)
) {
$this->llog('trace', 'Copying ' . $source->file_source->filename . ' to ' . $this->archive1);

if(!copy($source->file_source->filename, $this->archive1)) {
Expand Down

0 comments on commit 5e11ec3

Please sign in to comment.