5

Installed CiviCRM in a fresh Drupal install, customized the CiviCRM and added data. The actual Drupal site was built separately in a separate install. Now that it is complete, I merged the CiviCRM with the new Drupal Site (files and database). Everything appears to work except when logged into CiviCRM: http://example.com/civicrm/dashboard it says:

"Javascript must be enabled in your browser in order to use the dashboard features."

And yes Javascript is enabled. The CiviCRM Menu is all broken and such. Chrome also reports the following errors:

Uncaught TypeError: Object # has no method 'menu' jquery.textarearesizer.js:5Uncaught TypeError: Object # has no method 'TextAreaResizer' main.js:6Uncaught TypeError: Object # has no method 'cycle' jquery.textarearesizer.js:5Uncaught TypeError: Object # has no method 'TextAreaResizer'

Javascript compression under performance is not enabled. Any ideas?

4

2 回答 2

2

CiviCRM 使用 jQuery 对象作为 cj 而不是 $,以避免与 Drupal JQuery 库发生冲突。理论上,它们可以使用不同的版本,因为它们的命名空间不同(jQuery 官方支持使用 noConflict())。

您的冲突可能来自您的修改导致 Drupal 或 CiviCRM 在引导程序中的不同点加载其 jQuery 库,或者使其尝试多次加载 jQuery。这将使将 $ 转换为 cj 的操作在 Drupal jQuery 对象已经被实例化之后而不是之前获取它,从而使 Drupal 和/或 CiviCRM 没有它需要附加到 $ 对象的库(您是否使用 # 代替美元?)。

在相关页面及其 JavaScript 中搜索所有使用 noConflict() 的代码。你应该只在一个地方找到它。与 demo.civicrm.org 页面进行比较以查看差异,您可能会在某个地方找到一个额外的页面。修复它的最大希望是调整 Drupal 系统表中自定义模块的加载顺序,或者将第二个 noConflict() 调用设置为在没有 cj 对象的情况下有条件地运行。

于 2012-02-17T16:13:17.537 回答
1

我已经完成了一个错误报告。应用这个补丁以一种看似干净的方式为我解决了这个问题。这样,如果不需要,jQuery 库就不会被多次加载。

于 2012-08-16T12:14:48.443 回答