Can’t read image folder after upgrate to 1.5.0.1

1,939 人次阅读
没有评论

共计 2375 个字符,预计需要花费 6 分钟才能阅读完成。

After upgrad, when insert image to description, the programm can’t read the Media folder any more, and always shows SQL data error.
can Any one solve this ?

es I think there is a small issue with one of the files probably Tree.php.  When it looks for the image directories, sub directories and files it looks for the table “ _core_directory_storage” but with the most recent upgrade this table seems not to be included.  I don’t know whether this is intentional or not as this table does not seem to be used!

Whatever, the net result is that any sub-directories which are created do not appear.

I have tried adding _core_directory_storage to all my DBs and it seems to work so if you back up your database you could run

SET FOREIGN_KEY_CHECKS=0;

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- --------------------------------------------------------

--
-- Table structure for table `{your prefix}_core_directory_storage`
--

CREATE TABLE IF NOT EXISTS `{your prefix}_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 COMMENT='Directory storage' AUTO_INCREMENT=1 ;

--
-- Dumping data for table `{your prefix}_core_directory_storage`
--

--
-- Constraints for dumped tables
--

--
-- Constraints for table `{your prefix}_core_directory_storage`
--
ALTER TABLE `{your prefix}_core_directory_storage`
ADD CONSTRAINT `FK_DIRECTORY_PARENT_ID` FOREIGN KEY (`parent_id`) REFERENCES `{your prefix}_core_directory_storage` (`directory_id`) ON DELETE CASCADE ON UPDATE CASCADE;

SET FOREIGN_KEY_CHECKS=1;

OR go to

app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php—getDirsCollection

and comment out

$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);
}
}

To change the base image directory go to

app/code/core/Mage/Cms/Model/Wysiwyg/Config.php

and change the constant IMAGE_DIRECTORY =

within my installation the table was created (upgrade from 1.4.1.1 to 1.5.1.0). But it didn’t work, too.
I just had to set in app/code/core/Mage/Cms/Model/Wysiwyg/Config.php

 

const IMAGE_DIRECTORY = 'wysiwyg';

to

const IMAGE_DIRECTORY = '.';

Cheers

正文完
 0
评论(没有评论)