From 93663301911e306f0e1632977f99694aad8ae426 Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Tue, 27 Feb 2024 23:16:42 +0530 Subject: [PATCH 1/2] Sitegen: Fix Site Logo Data --- includes/Flows/Flows.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/includes/Flows/Flows.php b/includes/Flows/Flows.php index 3aa9c79..3db6957 100644 --- a/includes/Flows/Flows.php +++ b/includes/Flows/Flows.php @@ -69,8 +69,6 @@ final class Flows { 'siteLogo' => array( 'id' => 0, 'url' => '', - 'fileName' => '', - 'fileSize' => 0, ), // key-value store for social media accounts From 858b325902bed2417cde0623378142cfa5bbae99 Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Wed, 28 Feb 2024 14:48:58 +0530 Subject: [PATCH 2/2] CR: Update site icon and site logo --- includes/Services/FlowService.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/includes/Services/FlowService.php b/includes/Services/FlowService.php index 412835a..889a7d8 100644 --- a/includes/Services/FlowService.php +++ b/includes/Services/FlowService.php @@ -163,12 +163,15 @@ public static function update_data( $params ) { \update_option( Options::get_option_name( 'blog_description', false ), $data['data']['blogDescription'] ); } - if ( ( ! empty( $data['data']['siteLogo'] ) ) && ! empty( $data['data']['siteLogo']['id'] ) ) { - \update_option( Options::get_option_name( 'site_icon', false ), $data['data']['siteLogo']['id'] ); - \update_option( Options::get_option_name( 'site_logo', false ), $data['data']['siteLogo']['id'] ); + if ( ( 'sitegen' === Data::current_flow() && ! empty( $data['sitegen']['siteLogo'] ) ) && ! empty( $data['sitegen']['siteLogo']['id'] ) ) { + update_option( Options::get_option_name( 'site_icon', false ), $data['sitegen']['siteLogo']['id'] ); + update_option( Options::get_option_name( 'site_logo', false ), $data['sitegen']['siteLogo']['id'] ); + } elseif ( ( ! empty( $data['data']['siteLogo'] ) ) && ! empty( $data['data']['siteLogo']['id'] ) ) { + update_option( Options::get_option_name( 'site_icon', false ), $data['data']['siteLogo']['id'] ); + update_option( Options::get_option_name( 'site_logo', false ), $data['data']['siteLogo']['id'] ); } else { - \update_option( Options::get_option_name( 'site_icon', false ), 0 ); - \delete_option( Options::get_option_name( 'site_logo', false ) ); + update_option( Options::get_option_name( 'site_icon', false ), 0 ); + delete_option( Options::get_option_name( 'site_logo', false ) ); } // Add the version key to the $data before updating to options data.