Magento 1.8.1:如果使用符号链接,则会出现媒体目录错误

 缪宇驰 发布于 2023-01-30 16:01

我在Magento安装时遇到问题,在CMS中使用wysiwig编辑器插入图像时,文件夹会反复打开.

文件夹结构应该是:

- infortis
    - brands
    - fortis
    - ultimo

但我得到的是:

-infortis
    -infortis
        -infortis
            -infortis
                -infortis

这只是不断重复.

Magento版本1.8.1.任何帮助赞赏.

1 个回答
  • 我发现以下编辑使其按预期工作,并且也适用于非符号链接(dev)资源:

    在同一类中mentiond Mage_Cms_Helper_Wysiwyg_Images,应用这些补丁:

    # This patch file was generated by NetBeans IDE
    # It uses platform neutral UTF-8 encoding and \n newlines.
    --- <html>Images.php (<b>Today 4:14:50 PM</b>)</html>
    +++ <html><b>Current File</b></html>
    @@ -223,7 +223,7 @@
         public function getCurrentUrl()
         {
             if (!$this->_currentUrl) {
    -            $path = str_replace(Mage::getConfig()->getOptions()->getMediaDir(), '', $this->getCurrentPath());
    +            $path = str_replace(realpath(Mage::getConfig()->getOptions()->getMediaDir()), '', $this->getCurrentPath());
                 $path = trim($path, DS);
                 $this->_currentUrl = Mage::app()->getStore($this->_storeId)->getBaseUrl('media') .
                                      $this->convertPathToUrl($path) . '/';
    
    
    
    # This patch file was generated by NetBeans IDE
    # It uses platform neutral UTF-8 encoding and \n newlines.
    --- <html>Images.php (<b>f47f0ff</b>)</html>
    +++ <html><b>Current File</b></html>
    @@ -68,7 +68,7 @@
          */
         public function getStorageRoot()
         {
    -        return Mage::getConfig()->getOptions()->getMediaDir() . DS . Mage_Cms_Model_Wysiwyg_Config::IMAGE_DIRECTORY
    +        return realpath(Mage::getConfig()->getOptions()->getMediaDir()) . DS . Mage_Cms_Model_Wysiwyg_Config::IMAGE_DIRECTORY
                 . DS;
         }
    

    2023-01-30 16:03 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有