Notice: Undefined variable: element in entityreference_field_formatter_settings_form() (line 1141 of /www/html/sites/all/modules/contrib/entityreference/entityreference.module).

Location https://mysite.com/system/ajax

Comments

SangersDrupalDude created an issue. See original summary.

Max_Headroom’s picture

It's because $element is not declared. This needs attention in the function.
$element = array();

But the question is why we get that in the first place.

In my case, it is when I try to set up a Views field which is a reference.

StephenRobinson’s picture

Issue summary: View changes
JennyGB’s picture

Hi,

I have this issue too, using commerce 7.x-1.11 and commerce_paypal_wps 7.x-2.3
+ several patches on ctools and commerce (https://www.drupal.org/files/entityreference-checkboxes_default_value-18... + https://www.drupal.org/files/issues/commerce-1450736-20-.patch + https://www.drupal.org/files/issues/2195211-38-ctools-access-callback-fi...).

I have a field (entity_ref) in an content type (not related to commerce or product, it's an simple "event" content type type, showing date and town) pointing on "product display" content type (it shows what we sell, related to commerce Product, containing an commerce "Product reference" field).

When creating a view (showing event_ID + my entity_ref field), with filter on type=event, I noticed several "strange stuffs":
* first error: the view display not only events but a referenced product display too (as it doesn't use the filter on the content type "event")
* on the field "entity_ref", I see commerce "add to card" and "rendered entity" (from commerce product) - that should not be displayed here ?!? as no relationship on the Product commerce data
* on the field "entity_ref" (in view) I can only choose see ""rendered entity". I need the ID but then, I have the error.

Seems to me related to Commerce. Do you use Commerce too ?