summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--modules/optionwidgets/optionwidgets.module8
2 files changed, 6 insertions, 3 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 1d43a47..b7b24df 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -25,6 +25,7 @@ CCK 6.2-dev
- #298651 by smk-ka, yched - Nodereference/Userreference: Enhance performance on large sites.
This also adds 'autocomplete mode' widget settings (full string / beginning of string).
- #316292 by fractile81: Turn potentially time-consuming updates into multi-pass updates.
+- Remove unwanted 'N/A' option on noderef/userref fields using checkboxes.
CCK 6.2-rc10
============
diff --git a/modules/optionwidgets/optionwidgets.module b/modules/optionwidgets/optionwidgets.module
index 8be44c9..189ecd9 100644
--- a/modules/optionwidgets/optionwidgets.module
+++ b/modules/optionwidgets/optionwidgets.module
@@ -378,9 +378,11 @@ function optionwidgets_options($field) {
// Add an empty choice for :
// - non required radios
// - non required selects
- if (($field['widget']['type'] == 'optionwidgets_buttons' && !$field['required'] && !$field['multiple'])
- || (in_array($field['widget']['type'], array('optionwidgets_select', 'nodereference_select', 'nodereference_buttons', 'userreference_select', 'userreference_buttons')) && !$field['required'])) {
- $options = array('' => theme('optionwidgets_none', $field)) + $options;
+ if (!$field['required']) {
+ if ((in_array($field['widget']['type'], array('optionwidgets_buttons', 'nodereference_buttons', 'userreference_buttons')) && !$field['multiple'])
+ || (in_array($field['widget']['type'], array('optionwidgets_select', 'nodereference_select', 'userreference_select')))) {
+ $options = array('' => theme('optionwidgets_none', $field)) + $options;
+ }
}
return $options;
}