From 74def405ab96cb81d9b1993bd240efffd8a79407 Mon Sep 17 00:00:00 2001 From: "bradm@inmotionhosting.com" Date: Wed, 10 Feb 2021 12:59:31 -0500 Subject: [PATCH] Restore even if cannot set writable permissions. Fixes #437 --- admin/class-boldgrid-backup-admin-core.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/admin/class-boldgrid-backup-admin-core.php b/admin/class-boldgrid-backup-admin-core.php index 18c658e9..264774f6 100644 --- a/admin/class-boldgrid-backup-admin-core.php +++ b/admin/class-boldgrid-backup-admin-core.php @@ -2405,14 +2405,16 @@ public function restore_archive_file( $dryrun = false ) { do_action( 'boldgrid_backup_pre_restore', $info ); /* - * Attempt to fix any permissions related issues before the restoration begins. If we're - * unable to, the restoration may not continue. + * Attempt to fix any permissions related issues before the restoration begins. + * + * Historically, we'd abort the restoration if we couldn't set writable permissions. Now, we'll + * add a line to the logs and try anyways. A bug was encountered where we couldn't set writable + * permissions and yet the restore completed. Voodoo. */ if ( class_exists( 'ZipArchive' ) ) { if ( ! $this->restore_helper->set_writable_permissions( $info['filepath'] ) ) { $error_message = $this->restore_helper->get_last_error(); $this->logger->add( $error_message ); - return [ 'error' => $error_message ]; } } else { $this->logger->add( 'ZipArchive not available. Unable to set_writable_permissions. Trying restore anyways...' );