Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Just had someone do a D6 to D7 migration for us and now we have these notices popping up all over the site.
Notice: Undefined index: und in ctools_entity_from_field_context() (line 173 of C:\xampp\htdocs\sandboxsite2\sites\all\modules\ctools\plugins\relationships\entity_from_field.inc).
Still trying to pinpoint the cause. Couldn't find anyone else reporting this notice so I figured I'd get the ball rolling.
Comment | File | Size | Author |
---|---|---|---|
#9 | 1172084-ctools-entity-from-empty-field-notice.patch | 1018 bytes | Dave Reid |
Comments
Comment #1
bryancasler CreditAttribution: bryancasler commentedentity_from_field.inc
I'm not sure if this is related, but after the migration I now have a "Language" column with the value
"Undefined Language ()" appearing on my content page. http://awesomescreenshot.com/00dd9lp99
Could this be related? UPDATE: Fixed this language problem, it is not related.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedI suspect we're not completely properly handling field translation correctly, if this is happening. I know it's been an issue in Views, as well. I'm not entirely sure how we're supposed to do this correctly.
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedFor the field in question, is it possible to have no data?
Comment #4
cpelham CreditAttribution: cpelham commentedI have just started getting the same error message. My site was built in D7, not upgraded from D6.
My error message is only showing up (so far as I have noticed) on translated content types having a node reference (as well as a date field and a media field). I am just now making these translated nodes, so I suspect it is related to the references module. Just prior to the error message showing up, I applied a new patch to the references module which allows one to translate nodes with references without it throwing (other) errors. What the patch does is look up the child reference and then determine the nid of its translation if one exists and then populate the references field of the newly translated/created parent node with the correct translated child reference. I hope that makes sense.
Animelion, are you using references? I know it's possible it is unrelated or that the same error is being thrown for different reasons...
Comment #5
cpelham CreditAttribution: cpelham commentedI don't get that error on every page though so I'll have to look at the fields. Maybe some pages have an empty field that is causing problems? or isn't translated yet?
Comment #6
bryancasler CreditAttribution: bryancasler commentedThe person who did our migration did a botched job. I'm in the process of redoing the migration myself and this error hasn't cropped up yet. @cpelham I don't think I have any reference fields
Comment #7
pontus_nilssonBumped into the same problem, there is another issue, in Panels issue queue #1120022: Node reference field cannot be empty when viewed in node template that describes what I did to run into the problem.
Comment #8
jastraat CreditAttribution: jastraat commentedThis is also a problem with term reference fields. If you create a relationship in node template to "taxonomy term from node", the term reference field cannot be empty or it errors as above. I also tried to prevent the error by adding a check for whether or not the term field was empty in the selection rules (see http://drupal.org/node/1188466), but even when the selection rules fail, the relationship appears to still execute and error.
Comment #9
Dave ReidThe problem here is the check of
if (isset($entity->$field_name)) {
when this should be checking !empty() since all fields are defined as an empty array on entity load if they have no value.Comment #10
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted! Thanks!