From 5d8d95bae571edb1336b91186e7dda420f4cf032 Mon Sep 17 00:00:00 2001
From: Vladimir Roudakov <v_roudakov@yahoo.com>
Date: Tue, 28 Mar 2023 14:10:45 +1100
Subject: [PATCH] Issue #3349367 by jannakha, SteffiS., VladimirAus: can not
 create a child-theme out of /admin/appearance/settings/bootstrap4

---
 bootstrap4.theme | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/bootstrap4.theme b/bootstrap4.theme
index 5a32a30..e95a61a 100644
--- a/bootstrap4.theme
+++ b/bootstrap4.theme
@@ -311,12 +311,15 @@ function bootstrap4_form_system_theme_settings_subtheme_submit($form, FormStateI
       $fs->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS);
 
       $files = $fs->scanDirectory(
-        \Drupal::service('extension.list.theme')->getPath('bootstrap4') . DIRECTORY_SEPARATOR . $subforder . DIRECTORY_SEPARATOR, '/.*/');
+        \Drupal::service('extension.list.theme')
+          ->getPath('bootstrap4') . DIRECTORY_SEPARATOR . $subforder . DIRECTORY_SEPARATOR, '/.*css/', [
+        'recurse' => FALSE,
+      ]);
       foreach ($files as $file) {
-        //dump($file);
         $fileName = $file->filename;
         $fs->copy(
-          \Drupal::service('extension.list.theme')->getPath('bootstrap4') . DIRECTORY_SEPARATOR . $subforder . DIRECTORY_SEPARATOR . $fileName,
+          \Drupal::service('extension.list.theme')
+            ->getPath('bootstrap4') . DIRECTORY_SEPARATOR . $subforder . DIRECTORY_SEPARATOR . $fileName,
           $themePath . DIRECTORY_SEPARATOR . $subforder . DIRECTORY_SEPARATOR . $fileName, TRUE);
       }
     }
-- 
GitLab