I'm getting the following message with the newly patched dev.
Undefined index: und in question_answer_preprocess() (line 141 of /home/hopest/public_html/sites/all/modules/question_answer/question_answer.module).
any ideas?
I'm getting the following message with the newly patched dev.
Undefined index: und in question_answer_preprocess() (line 141 of /home/hopest/public_html/sites/all/modules/question_answer/question_answer.module).
any ideas?
Comments
Comment #1
jcisio commentedIt looks like the node and the answer field do not use the same language!
Can you debug a little bit? At the line before, print the content of
$node->{$qtype[$node->type]['answer']}and$node->language(the latter should be "und", but in case of...).Comment #2
Stephen Rockwell commentedsure, just to be clear though I don't have localization or content translation modules turned on.
Comment #3
SlipperyJim commentedI'm getting the same error message with the most recent dev release. I don't have any localizations or non-English content and I'm running the most recent LAMP components (Ubuntu 10.10).
Comment #4
narnou commentedI have got exactly the same issue. Printing
$qtype[$node->type]['answer']gives me a string : field_best_answerThat's of course the name of the fileld i used for the module. But it's not an array so
$node->{$qtype[$node->type]['answer']}['und'][0]['value']should'nt work...Comment #5
jcisio commentedIf
$qtype[$node->type]['answer'] == 'field_best_answer'then$node->{$qtype[$node->type]['answer']}['und'][0]['value'] == $node->field_best_answer['und'][0]['value']and it should work.Which version of PHP are you using?
Comment #6
narnou commentedThx i'm gonna try this, my version is 5.3.5
Comment #7
Peter Arius commentedI still saw this error with:
I found out that it only shows up when the selected_answer field is empty. I worked around it by making it a required field with default value 0.
HTH :).
Comment #8
Anonymous (not verified) commentedGot the error tonight. The workaround above didn't work for me.
It seems like the field has no language, while the node has. So using $node->language as index for the field is bad: should be using "und" instead. This is what I saw in the arrays via dpm().
The modules seems to have other serious problems here, so I can't help mucht about this issue. Just wanted to tell you about the circumstanced described above.
Comment #9
jcisio commentedCommit a fix for this http://drupalcode.org/project/question_answer.git/commit/2952886
Thanks all.