I'm going to continue to see if I can figure this out, but I thought I'd post in case it's been discussed before.
I've got a custom content type whose keywords I'd like to check with this module, but the Meta Tags Quick field I've got in that content type isn't showing up in the dropdown when I try to add it to the content type. It isn't displaying any options at all, but for the disable option.
It IS, however, working fine on the field I added to the Basic Page type. It also allows me to choose Body for the keywords, if I want to.
Thanks for any help!
Joe
Comments
Comment #1
miruoss commentedHi there and sorry for the late answer! I cannot reproduce this behaviour. I can create a new content type, add a meta tags quick field to it and it shows in the dropdown. Did you manage to get this working?
Comment #2
miruoss commentedComment #3
miruoss commentedComment #4
petr illekI've just reproduce this behaviour. I can select the source for keywords on the basic page, but not on any of my custom pages type.
Comment #5
spidersilk commentedI seem to be running into the same thing, although not on all custom content types. On a site with about a dozen different content types, two of them show no fields at all in the pop-up menu under "Field defining the keywords". The others all show all the fields, including the keywords field added by Meta Tags Quick.
I haven't been able to determine why the difference - both of the affected content types do have the keywords field and several other fields, but the only thing that shows up in that menu for them is "Disable keyword checking". But there don't seem to be any significant differences between those two types and the others.
Does anyone have any idea what might be causing this?
Comment #6
spidersilk commentedChanged title to be more specific, updated version number because issue is still present in current version, re-opened issue.
Comment #7
spidersilk commentedOK, I think I've figured this one out. I did some testing with Devel to find out at what point the check for fields was failing, and found that both the call to field_info_instances() on line 233 of keyword_rules.module and the call to field_info_extra_fields() on line 242 were coming up with nothing - using dpm() to check the value of the arrays they were supposed to be generating showed empty arrays in both cases.
Since the first argument in both cases ('node') was pretty straightforward, I figured the problem had to be in the second, which was $form['orig_type']['#value'] in both cases. I checked the contents of $form in both cases, and found that for both the content types I was having trouble with, the value of $form['orig_type']['#value'] was NOT the current machine name of the content type! So both of them had apparently had their machine name changed at some point, presumably when the names of the content types had been changed (not by me; more than one developer has worked on this site).
I'm not sure why orig_type was being used rather than type, but I tried changing $form['orig_type']['#value'] to $form['type']['#default_value'] in each of those two lines, and voila, now the fields show up fine for both those content types.
So for anyone else who's having this issue, just change the following two lines in keyword_rules.module:
Line 233: change
$fieldarr = field_info_instances('node', $form['orig_type']['#value']);to
$fieldarr = field_info_instances('node', $form['type']['#default_value']);Line 242: change
$extra_fields = field_info_extra_fields('node', $form['orig_type']['#value'], 'form');to
$extra_fields = field_info_extra_fields('node', $form['type']['#default_value'], 'form');(Line numbers are from version 7.x-1.6 - if you're using 7.x-1.7 which was released today, it's lines 237 and 246.)
Unless there is an important reason for the orig_type property being used instead of type, maybe this could be changed in the next version to prevent this problem from happening to others?
Comment #8
miruoss commentedHey Lynna, thank you very much for the investigation! Indeed i guess using the original type name doesn't make much sense there. I commited the changes you proposed. Can someone who currently has the issue please verify that this solves it by ckecking out the development bundle coming up soon? Alternatively you can apply the attached patch against version 7.x-1.7.
Thanks,
Michael
Comment #9
cubeinspire commentedDear Drupalers,
I've had the same issue and implementing the changes suggested on #7 solved the problem.
Please update the module version with the suggested corrections!
Comment #10
axael commentedDear miruoss,
Had the same problem with one of my content types.
The patch submitted here seems to fix the problem :)
Thanks !
Comment #11
miruoss commentedFixed in 7x-1.8.