- Issue created by @bhagyas
- 🇦🇺Australia j-henriquez
I encountered the same issue testing on a local environment docker based. I've taken the proposed solution put forward by bhagyas and created a module
Run Media library importer on a Docker container based on Alpine
Replace GLOB_BRACE usage with the following.
1. Add this method to the class.
function getMediaFiles($media_folder, $media_extensions) {
// Split the extensions into an array
$extensions = explode(',', $media_extensions);
// Initialize an array to hold the results
$media_files = [];
// Loop through each extension and merge the results
foreach ($extensions as $extension) {
$media_files = array_merge($media_files, glob("$media_folder/*.$extension"));
}
return $media_files;
}
2. Replace the usages of GLOB_BRACE
// $media_files = glob("$media_folder/*.{" . $media_extensions . "}", GLOB_BRACE);
must be replaced with
$media_files = $this->getMediaFiles($media_folder, $media_extensions);
on both places within MediaLibraryImporterService.php, rename arguments as needed.
Active
2.0
Code
I encountered the same issue testing on a local environment docker based. I've taken the proposed solution put forward by bhagyas and created a module