这是我与drupal的第一步.
我已经为我的文章创建了分类法层次结构,现在我正在尝试向内容类型"文章"和"媒体"添加新字段,以便内容管理员可以为其新内容指定"类别".
所以我去过Structure> Content Types> Article> Manage Fields然后"Add new field":
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.**
Run Code Online (Sandbox Code Playgroud)
所有类型的字段都会发生这种情况,即使是文本字段也是最基本的字段.知道为什么会这样吗?
正如glumbo所提到的,这里的问题是由jQuery 1.7更新引起的.从jQuery 1.6开始,应该使用.prop()函数访问DOM属性.某些修补程序解决方案存在一个未解决的问题:
您需要替换.attr() jQuery的函数调用.prop()中/modules/field_ui/field_ui.js的下面几行:
100: $(this).html(html).attr('disabled', disabled ? 'disabled' : '');
253: $(ajaxElements).attr('disabled', true);
Run Code Online (Sandbox Code Playgroud)
请注意,此修复修改了Drupal核心模块,您可能想要使用补丁(Dries会杀死kitty :).