gpt4 book ai didi

Magento 1.8.1 : media directory bug if using symlink

转载 作者:行者123 更新时间:2023-12-03 03:11:39 28 4
gpt4 key购买 nike

我的 Magento 安装遇到问题,在 CMS 中,当我使用 wysiwig 编辑器插入图像时,文件夹不断重复打开。

文件夹结构应为:

- infortis
- brands
- fortis
- ultimo

但是我得到的是:

-infortis
-infortis
-infortis
-infortis
-infortis

而且这种情况不断重复。

Magento 版本 1.8.1。任何帮助表示赞赏。

最佳答案

我发现以下编辑使其按预期工作,并且也适用于非符号链接(symbolic link)(开发)资源:

在与提到的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;
}

关于Magento 1.8.1 : media directory bug if using symlink,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21434859/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com