Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
cck
Commits
8e8c813d
Commit
8e8c813d
authored
Dec 15, 2009
by
yched
Browse files
updated after core [
#639466
] (hook_options_list)
parent
a0af8a9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/node_reference/node_reference.module
View file @
8e8c813d
...
...
@@ -476,6 +476,9 @@ function nodereference_field_widget_error($element, $error) {
* ),
* ...
* )
* @todo Check whether we still need the 'rendered' value (hook_options_list()
* does not need it anymore). Should probably be clearer after the 'Views'
* mode is ported.
*/
function
_node_reference_potential_references
(
$field
,
$string
=
''
,
$match
=
'contains'
,
$ids
=
array
(),
$limit
=
NULL
)
{
static
$results
=
array
();
...
...
@@ -652,22 +655,15 @@ function node_reference_field_prepare_translation($obj_type, $object, $field, $i
}
/**
* Implements hook_allowed_values().
*
* @see options_options()
* @link http://drupal.org/node/639466 @endlink
*
* A problem with this function is that its result set can be as large
* as the whole set of nodes on a site, which can be huge.
*
* @param array $field
* Implements hook_options_list().
*/
function
node_reference_
allowed_values
(
$field
)
{
function
node_reference_
options_list
(
$field
)
{
$references
=
_node_reference_potential_references
(
$field
);
// @todo Support optgroups ? I think this was added in late CCK D6.
$options
=
array
();
foreach
(
$references
as
$key
=>
$value
)
{
$options
[
$key
]
=
$value
[
'
rendered
'
];
$options
[
$key
]
=
$value
[
'
title
'
];
}
return
$options
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment