Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to add a new field to a content type, widget drop down not working

Tags:

drupal-7

These are my first steps with drupal.

I have created a taxonomy hierarchy for my articles and now I am trying to add a new field to the content type "Article" and "Media" so the content admin can assign a "category" to his new content.

So I've been to Structure > Content Types > Article > Manage Fields Then "Add new field" with :

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.**

This is happening with all types of fields, even with text fields, the most basic one. Any idea why is this happening ?

like image 599
HBR Avatar asked Apr 18 '12 14:04

HBR


2 Answers

The problem is with jquery update. If you are using jquery 1.7 you will get this problem

like image 45
Matthew Hui Avatar answered Nov 04 '22 20:11

Matthew Hui


As glumbo mentioned, the problem here is caused by jQuery 1.7 update. As of jQuery 1.6 DOM properties should be accessed using .prop() function. There is an open issue with some hotfix solution:

You need to replace .attr() jQuery function call with .prop() in /modules/field_ui/field_ui.js at following lines:

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

Please note that this fix modifies a Drupal core module and you'll probably want to use a patch (Dries would kill the kitty anyway:).

like image 180
stuchl4n3k Avatar answered Nov 04 '22 19:11

stuchl4n3k