Drupal Views - 来自地狱的 Ajax 错误警报框
我在通常使用 ajax 打开新表单来修改该操作的属性的视图中所做的任何操作都会给我一个警报框,其中显示应该使用 ajax 加载的代码:
Anything I do in views that would normally use ajax to open up a new form to modify properties of that action is giving me an alert box of what looks like the code that should be loading with ajax:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
此问题可能还有另一个根源(如果之前的评论没有解决问题):
主题开发人员模块。
这是一个对于主题和调试非常有用的模块,但是当启用它时,它也会产生奇怪的 AJAX 错误消息,类似于尝试在视图字段设置中设置不同参数时问题中的消息。
正如项目页面所示:“需要时启用它,然后禁用它。”
There can be another source of this problem (if the previous comments didn't solve it):
the Theme developer module.
This is a really helpful module for theming and debugging, but when having it enabled, it can also produce weird AJAX error messages, similar to the one in the question when trying to set different parameters in Views field settings.
As the project's page suggests: "Enable it when needed, and disable it afterwards."
如果您将较新版本的 jQuery 添加到您的 Drupal 安装中,它可能会导致 AJAX 和视图 UI 出现问题。
我以前也遇到过同样的情况。我恢复到 Drupal 附带的原始 jQuery 版本,一切都恢复正常。
If you add a newer version of jQuery to your Drupal install it can create problems with AJAX and Views UI.
I have found myself in the exact same position before. I reverted back to the original jQuery version shipped with Drupal and everything was back to normal.
当 AJAX 小部件(例如面板)尝试访问无效或不再有效的菜单回调时,我也看到过这种情况发生。我会在菜单路由器中搜索以下内容:
然后确保
page_callback
列中提到的函数存在。更改权限也可能导致此问题。
检查
access_callback
列的内容,并尝试使用不同的用户角色调试该路径(/admin/build/views/ajax/add-item/community/default/field)
看看会发生什么。I've seen it happen too when the AJAX widget (for example, Panels) is trying to access an invalid, or no longer valid menu callback. I would search the menu router for things like:
Then make sure that the function mentioned in the
page_callback
column exists.Changed permissions can also cause this problem.
Check what the
access_callback
column says, and try debugging that path(/admin/build/views/ajax/add-item/community/default/field)
with different user roles to see what happens.只是为了完整起见:我刚刚发现可能导致这种行为的另一个主题是 ThemeKey 模块(尽管如此,它在其预期用途方面做了出色的工作......)。至少在我的网站上禁用它可以解决问题。
Just for completeness: I just figured out that another theme that might cause such a behaviour is the ThemeKey module (which - dispite of that- does a great work in what it is intended to...). At least disabling it at my site did the trick.