When there no terms in the vocab and the widget set to "Check boxes/radio buttons" you'll see just the title of the vocab without any options. I'm attaching a patch for fix this one.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu’s picture

+++ b/includes/og_vocab.og_vocab.inc
@@ -253,8 +253,32 @@ function og_vocab_element_after_build($form, &$form_state) {
+    foreach ($form[$field_name][LANGUAGE_NONE][0] as $key => &$info) {

I don't think we should work with the form element, as we could determine if there are terms we got in the query.

RoySegall’s picture

I didn't took care with field element which not holds the #options property. Attaching fix.

RoySegall’s picture

Status: Needs review » Needs work
FileSize
3.63 KB
3.02 KB

I'm uploading the fix and a test a skeleton for the simple test. I'll continue work on this tomorrow.

RoySegall’s picture

Status: Needs work » Needs review
FileSize
5.21 KB
3.47 KB
amitaibu’s picture

Status: Needs review » Needs work
+++ b/includes/og_vocab.og_vocab.inc
@@ -253,8 +253,31 @@ function og_vocab_element_after_build($form, &$form_state) {
+    foreach ($form[$field_name][LANGUAGE_NONE][0] as $key => &$info) {

As noted above, the count check should be against a query, not the form element.

amitaibu’s picture

Assigned: Unassigned » amitaibu

Re-assigned to myself.

amitaibu’s picture

Patch looks good, just minor nitpicks.

+++ b/includes/og_vocab.og_vocab.inc
@@ -253,8 +253,31 @@ function og_vocab_element_after_build($form, &$form_state) {
+      unset($form[$field_name][LANGUAGE_NONE]);

We need to set #access to FALSE.

amitaibu’s picture

Assigned: amitaibu » RoySegall

Actually, re-assigned to RoySegall, since very little left to do.