Commit 8798d521 authored by yched's avatar yched

#114346 - fix error on empty noderef fields - slightly better

parent 7f0acced
......@@ -109,9 +109,9 @@ function nodereference_field($op, &$node, $field, &$items, $teaser, $page) {
case 'validate':
$refs = _nodereference_potential_references($field, TRUE);
foreach ($items as $delta => $item) {
$error_field = isset($item['error_field']) ? $item['error_field'] : '';
unset($item['error_field']);
if (!empty($item['nid'])) {
$error_field = isset($item['error_field']) ? $item['error_field'] : '';
unset($item['error_field']);
if (!in_array($item['nid'], array_keys($refs))) {
form_set_error($error_field, t('This post can\'t be referenced.'));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment