I'm creating a view which references a Field Collection containing two Temperature fields (Minimum temperature and Maximum temperature). Whenever I try to add the fields to my view, I receive an error such as "Undefined Variable: element in temperature_field_format_settings_form()" on line 5 of temperature.module.

Is this because it's in a Field collection? All of my other fields from field collections seem to be working, but I can't find any other differences that would cause this issue.

Thanks!

Comments

replicaobscura’s picture

That was supposed to be line 585, not line 5. I'm not sure how that happened :)

replicaobscura’s picture

I'm not sure why others haven't noticed this error--looking at the code, $element is being used without being defined. I'm pretty sure the temperature_field_formatter_settings_form method is missing the block of code which is supposed to create the $element array.

aklump’s picture

StatusFileSize
new1.26 KB

I believe you're correct, in fact that entire function (I believe) can be removed. Would you be able to remove the function and let me know if that fixed the error for you, if so I will then commit the patch. You can either remove temperature_field_formatter_settings_form() by hand or apply the attached patch. Please let me know your progress.

Thanks,
aklump

aklump’s picture

Hang on that patch is not correct... let me get you a new one

aklump’s picture

Title: Undefined Variable: Element » New Patch, Please Use
StatusFileSize
new2.13 KB

Here is a correct patch file. I'll wait to hear back if this fixes your errors before committing.

aklump’s picture

Status: Active » Fixed

I've committed this to the 7.x-1.x branch

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.