【发布时间】:2015-01-05 18:25:17
【问题描述】:
我使用 Drupal 7.33 和 Image Field。在浏览器中打开 JS 时,我无法上传或删除图像。所以这不可能是文件权限或php问题。
来自我的 nginx 日志文件:
[warn] 812#0: *7074 a client request body is buffered to a temporary
file /var/lib/nginx/body/0000000023, client: 174.61.242.24,
server: www.example.com, request: "POST /file/ajax/field_foto/und/0/form
Bw9u5Xhbowcr3qGBI4mPYtnNtC0AUHpyi2L_xesa9qY HTTP/1.1", host: "www.example.com",
referrer: "http://www.example.com/node/8/edit"
我还将 jQuery 更新模块与 1.5 版一起用于管理站点。
控制台错误:
'Attr.nodeValue' is deprecated. Please use 'value' instead.
jquery-1.5.2.min.js:16
Refused to display 'http://www.example.com/file/ajax/field_foto/und/0/form-wNmrRuGxQgvWtN_glNEmnFI34Bm-m_sMC-iuGVn0Wmk'
in a frame because it set 'X-Frame-Options' to 'DENY'. about:blank:1
Uncaught SecurityError: Sandbox access violation: Blocked a frame at
"http://www.example.com" from accessing a frame at "null".
The frame being accessed is sandboxed and lacks the "allow-same-origin" flag.
js_4QRrlXrX4C71F2nR2dAhf6BenDZnNcl6GHuDAJyosZw.js:101t
js_4QRrlXrX4C71F2nR2dAhf6BenDZnNcl6GHuDAJyosZw.js:101
使用主题提供的默认 jQuery 版本,当我尝试删除文件时出现此错误(弹出):
An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /file/ajax/field_foto/und/0/form-3_O5Rsz9PLD9NJCuwI157oZdHW1XJ8gOdTtJYQTT1oI
StatusText: n/a
ResponseText:
ReadyState: undefined
我已经用 Chrome、Firefox 和 Safari 对此进行了测试。
Drupal 的状态报告正常。
感谢您的帮助;)
【问题讨论】:
-
你浏览器的开发者控制台有没有js报错?
-
是的,谢谢 - 我已将其添加到问题中。
-
AFAIK,图像字段不使用任何 iframe。节点上还有哪些其他字段?
-
没有更多字段,只有图像和正文。
-
你有“覆盖”吗?也许这就是问题所在。你为什么在管理主题上使用 jquery update ?我建议您使用 drupal 附带的标准 jquery 作为管理主题。 jquery update 的最新开发版本有一个选项。