无法向内容类型添加新字段,窗口小部件下拉列表无法正常工作

时间:2012-04-18 14:59:41

标签: drupal-7

这是我与drupal的第一步。

我为我的文章创建了分类层次结构,现在我正在尝试向内容类型“文章”和“媒体”添加新字段,以便内容管理员可以为其新内容指定“类别”。

所以我去过Structure>内容类型>文章>管理字段 然后使用以下“添加新字段”

1- Label = Category
2- Name = "field_category
3- Field = "Term reference"
**4- Automatically changes to "Select list" but I am unable to see the drop down list options. Clicking the list doesn't do anything, I couldn't select Autocomplete or any other value I've seen on forums & tutorials. Using firebug I could see the options are there, but the list doesn't show up.**

所有类型的字段都会发生这种情况,即使是文本字段也是最基本的字段。 知道为什么会这样吗?

2 个答案:

答案 0 :(得分:5)

正如glumbo所提到的,这里的问题是由 jQuery 1.7 update 引起的。从jQuery 1.6开始,应使用.prop()函数访问DOM属性。 有open issue修补程序解决方案

您需要使用/modules/field_ui/field_ui.js中的 .prop()替换 .attr() jQuery函数调用,如下所示:

100:      $(this).html(html).attr('disabled', disabled ? 'disabled' : '');
253:      $(ajaxElements).attr('disabled', true);

请注意,此修复修改了Drupal核心模块,您可能想要使用补丁(Dries会杀死kitty :)。

答案 1 :(得分:1)

问题在于jquery更新。如果您使用的是jquery 1.7,您将遇到此问题

相关问题