diff --git a/includes/entity.wrapper.inc b/includes/entity.wrapper.inc index 6b85c5b..a21bc61 100644 --- a/includes/entity.wrapper.inc +++ b/includes/entity.wrapper.inc @@ -189,7 +189,7 @@ abstract class EntityMetadataWrapper { public function optionsList($op = 'edit') { if (isset($this->info['options list']) && is_callable($this->info['options list'])) { $name = isset($this->info['name']) ? $this->info['name'] : NULL; - return call_user_func($this->info['options list'], $name, $this->info, $op); + return call_user_func($this->info['options list'], $name, $this->info, $op, $this); } return FALSE; } diff --git a/modules/callbacks.inc b/modules/callbacks.inc index 06bad9e..24038cf 100644 --- a/modules/callbacks.inc +++ b/modules/callbacks.inc @@ -408,14 +408,14 @@ function entity_metadata_field_property_set($entity, $name, $value, $langcode, $ /** * Callback returning the options list of a field. */ -function entity_metadata_field_options_list($name, $info) { +function entity_metadata_field_options_list($name, $info, $op, $entity = NULL) { if (is_numeric($name) && isset($info['parent'])) { // The options list is to be returned for a single item of a multiple field. $field_property_info = $info['parent']->info(); $name = $field_property_info['name']; } if ($field = field_info_field($name)) { - return (array) module_invoke($field['module'], 'options_list', $field); + return (array) module_invoke($field['module'], 'options_list', $field, NULL, $entity ? $entity->type() : NULL, $entity ? $entity->value() : NULL); } }