| 1 |
<?php |
<?php |
| 2 |
// $Id: nodereference.module,v 1.39.2.35 2008/03/24 01:58:34 yched Exp $ |
// $Id: nodereference.module,v 1.39.2.36 2008/04/28 23:50:29 karens Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 344 |
form_set_error($error_field, t('%name : Title mismatch. Please check your selection.'), array('%name' => t($field['widget']['label']))); |
form_set_error($error_field, t('%name : Title mismatch. Please check your selection.'), array('%name' => t($field['widget']['label']))); |
| 345 |
} |
} |
| 346 |
} |
} |
| 347 |
|
else { |
| 348 |
|
// no explicit nid |
| 349 |
|
$nids = _nodereference_potential_references($field, FALSE, $item['node_name'], TRUE); |
| 350 |
|
if (empty($nids)) { |
| 351 |
|
form_set_error($error_field, t('%name: Found no valid post with that title.', array('%name' => t($field['widget']['label'])))); |
| 352 |
|
} |
| 353 |
|
else { |
| 354 |
|
// TODO: |
| 355 |
|
// the best thing would be to present the user with an additional form, |
| 356 |
|
// allowing the user to choose between valid candidates with the same title |
| 357 |
|
// ATM, we pick the first matching candidate... |
| 358 |
|
$nid = array_shift(array_keys($nids)); |
| 359 |
|
} |
| 360 |
|
} |
| 361 |
} |
} |
| 362 |
} |
} |
| 363 |
return; |
return; |