The fix for this is to override the core file with a local copy:
mkdir -p app/code/core/Mage/Cms/Model/Wysiwyg/Images/ cp app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php app/code/local/Mage/Cms/Model/Wysiwyg/Images/Storage.phpAnd then comment out the following Line 62-70
$subDirectories = Mage::getModel('core/file_storage_directory_database')->getSubdirectories($path); foreach ($subDirectories as $directory) { $fullPath = rtrim($path, DS) . DS . $directory['name']; if (!file_exists($fullPath)) { mkdir($fullPath, 0777, true); } }
So they will look like this:
/* $subDirectories = Mage::getModel('core/file_storage_directory_database')->getSubdirectories($path); foreach ($subDirectories as $directory) { $fullPath = rtrim($path, DS) . DS . $directory['name']; if (!file_exists($fullPath)) { mkdir($fullPath, 0777, true); } } */
and then we want to run the following SQL Query
SET FOREIGN_KEY_CHECKS=0; SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -------------------------------------------------------- -- -- Table structure for table `core_directory_storage` -- CREATE TABLE IF NOT EXISTS `core_directory_storage` ( `directory_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '', `path` varchar(255) NOT NULL DEFAULT '', `upload_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `parent_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`directory_id`), UNIQUE KEY `IDX_DIRECTORY_PATH` (`name`,`path`), KEY `parent_id` (`parent_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8_general_ci COMMENT='Directory storage' AUTO_INCREMENT=1 ; ALTER TABLE `core_directory_storage` ADD CONSTRAINT `FK_DIRECTORY_PARENT_ID` FOREIGN KEY (`parent_id`) REFERENCES `core_directory_storage` (`directory_id`) ON DELETE CASCADE ON UPDATE CASCADE; CREATE TABLE `core_file_storage` ( `file_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `content` LONGBLOB NOT NULL, `upload_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `filename` VARCHAR(255) NOT NULL DEFAULT '', `directory_id` INT(10) UNSIGNED NULL DEFAULT NULL, `directory` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`file_id`), UNIQUE INDEX `IDX_FILENAME` (`filename`, `directory`), INDEX `directory_id` (`directory_id`), CONSTRAINT `FK_FILE_DIRECTORY` FOREIGN KEY (`directory_id`) REFERENCES `core_directory_storage` (`directory_id`) ON UPDATE CASCADE ON DELETE CASCADE ) COMMENT='File storage' COLLATE='utf8_general_ci' ENGINE=InnoDB ROW_FORMAT=DEFAULT; SET FOREIGN_KEY_CHECKS=1;