Commit ed518aa6 authored by Jonathan McLaughlin's avatar Jonathan McLaughlin
Browse files

Issue #3228476: Number of backups to keep in schedule settings not working...

Issue #3228476: Number of backups to keep in schedule settings not working with Flysystem FTP destination
parent 1e5cac98
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ class FlysystemDestination extends DirectoryDestination {
   *
   * @throws \Drupal\backup_migrate\Core\Exception\BackupMigrateException
   */
  function saveFile(BackupFileReadableInterface $file) {
  function saveTheFile(BackupFileReadableInterface $file) {
    // Check if the directory exists.
    $this->checkDirectory();

@@ -82,7 +82,7 @@ class FlysystemDestination extends DirectoryDestination {
  /**
   * {@inheritdoc}
   */
  public function deleteFile($id) {
  public function deleteTheFile($id): bool {
    if ($file = $this->getFile($id)) {
      if ($this->flysystem->has($this->idToPath($id))) {
        return $this->flysystem->delete($this->idToPath($id));
@@ -91,7 +91,6 @@ class FlysystemDestination extends DirectoryDestination {
    return FALSE;
  }


  /**
   * Get the entire file list from this destination.
   *
@@ -295,10 +294,10 @@ class FlysystemDestination extends DirectoryDestination {
        }
        else {
          if ($sort == 'name') {
            return $a->getFullName() > $b->getFullName();
            return $b->getFullName() <=> $a->getFullName();
          }
          // @TODO: fix this in core
          return $a->getMeta($sort) > $b->getMeta($sort);
          return $b->getMeta($sort) <=> $a->getMeta($sort);
        }
      });
    }