【问题标题】:Images uploading, going to the /media/tmp, but not saving in media/catalog after saving product [Magento]图片上传,进入/media/tmp,但保存产品后没有保存在媒体/目录中[Magento]
【发布时间】:2011-08-25 09:37:30
【问题描述】:

正如标题所说,我无法保存产品的图片。

我编辑产品(分组产品),进入图像选项卡,上传图像(这很好,当我翻转时图像就在那里,我可以在 /tmp 文件夹中看到它的 URL),选择商店视图并继续保存产品。

检查前端,没有图像。再次检查/编辑产品,那里也没有图像。它只是消失了(尽管它保留在 /tmp 文件夹中)。

你能帮我解决这个问题吗?我已将所有权限暂时设置为 777,但仍然没有运气。

固定:http://www.magentocommerce.com/boards/viewthread/4348/P45/#t327010

【问题讨论】:

标签: image magento upload


【解决方案1】:

解决了!!! 从 M1 迁移到 M2 后,我遇到了这个问题。编辑任何产品时,添加/删除图像不起作用。它显示它何时上传但保存后它不保存。我已应用此查询来解决问题。这里 media_gallery 属性 id 是 703。

DELETE FROM catalog_product_entity_varchar WHERE attribute_id = 703 and value = 0

DELETE FROM catalog_product_entity_varchar WHERE attribute_id = 703 and value = NULL

【讨论】:

  • 它在从 1.9.x 到 2.3 的 Magento 迁移中完美运行。获取attribute_id 运行查询sql SELECT * FROM `eav_attribute` WHERE `attribute_code` = 'media_gallery'
【解决方案2】:

如果有人仍然面临同样的问题,可能是因为prototype.js 版本。

将 js/mage/adminhtml/product.js 中的 xxx.toJSON() 调用更改为 Object.toJSON(xxx)。例如来自这个:

$(this.idPrefix + 'save_attributes').value = this.attributes.toJSON();

到这里:

$(this.idPrefix + 'save_attributes').value = Object.toJSON(this.attributes);

【讨论】:

    【解决方案3】:

    当我从 M1 迁移到 M2 时,我遇到了类似的问题。
    调试后我发现在 eav_attribute db 表中,原来 M2 中属性 media_gallery 的 backend_type 设置为 static,但迁移后它得到了替换为varchar。
    我已将其改回static,并形成我的图像上传和保存开始为产品工作。
    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-02-14
      • 2013-02-10
      • 2012-02-12
      • 1970-01-01
      • 2021-09-11
      • 1970-01-01
      • 2021-10-09
      相关资源
      最近更新 更多