From ef2b6919d467cff9b4f40f6f403cfa87d2bba507 Mon Sep 17 00:00:00 2001 From: Kevin Porras Date: Tue, 12 Sep 2023 11:47:29 -0600 Subject: [PATCH] Fix clone database workflow creation. --- src/Models/Environment.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Models/Environment.php b/src/Models/Environment.php index 055d50a13..49c962030 100755 --- a/src/Models/Environment.php +++ b/src/Models/Environment.php @@ -168,10 +168,15 @@ public function cloneDatabase(Environment $from_env, array $options = []) if (isset($options['updatedb'])) { $options['updatedb'] = (int)$options['updatedb']; } - $params = array_merge( - ['from_environment' => $from_env->getName(),], - $options - ); + $params = [ + 'from_environment' => $from_env->getName(), + 'updatedb' => $options['updatedb'] ?? 0, + 'clear_cache' => $options['clear_cache'] ?? false, + ]; + if (!empty($options['from_url']) && !empty($options['to_url'])) { + $params['wp_replace_siteurl']['from_url'] = $options['from_url']; + $params['wp_replace_siteurl']['to_url'] = $options['to_url']; + } return $this->getWorkflows()->create( 'clone_database', compact('params')