Revert "Issue #1621356 by oriol_e9g, joachim, tim.plunkett, dsdeiz: Pass all the parameters of hook_options_list() to options_list_callback"

This reverts commit ffe9f9178b.
merge-requests/26/head
David Rothstein 2017-01-31 13:23:33 -05:00
parent 2f3b6e8912
commit 13ece45695
2 changed files with 3 additions and 13 deletions

View File

@ -8,7 +8,7 @@
/**
* Allowed values callback.
*/
function list_test_allowed_values_callback($field, $instance, $entity_type, $entity) {
function list_test_allowed_values_callback($field) {
$values = array(
'Group 1' => array(
0 => 'Zero',

View File

@ -1493,7 +1493,7 @@ function taxonomy_field_widget_info_alter(&$info) {
*/
function taxonomy_options_list($field, $instance, $entity_type, $entity) {
$function = !empty($field['settings']['options_list_callback']) ? $field['settings']['options_list_callback'] : 'taxonomy_allowed_values';
return $function($field, $instance, $entity_type, $entity);
return $function($field);
}
/**
@ -1646,20 +1646,10 @@ function taxonomy_field_formatter_view($entity_type, $entity, $field, $instance,
*
* @param $field
* The field definition.
* @param $instance
* The instance definition. It is recommended to only use instance level
* properties to filter out values from a list defined by field level
* properties.
* @param $entity_type
* The entity type the field is attached to.
* @param $entity
* The entity object the field is attached to, or NULL if no entity
* exists (e.g. in field settings page).
*
* @return
* The array of valid terms for this field, keyed by term id.
*/
function taxonomy_allowed_values($field, $instance, $entity_type, $entity) {
function taxonomy_allowed_values($field) {
$options = array();
foreach ($field['settings']['allowed_values'] as $tree) {
if ($vocabulary = taxonomy_vocabulary_machine_name_load($tree['vocabulary'])) {