Steps to reproduce:
- create boolean field on a node content type
- enter some 'help text' (description)
- use 'single on/off checkbox' as the widget

Expected:
- checkbox & help text display on the node edit page

Actual:
- help text displays, but the checkbox is nowhere to be found; not present in markup, so it's not a CSS issue; disabling JS does not help

Some checkboxes on edit-node pages do not get displayed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yuriy.babenko’s picture

Status: Active » Needs review
FileSize
539 bytes

Bug is in twitter_bootstrap_form_element(). Patch attached. (Disclaimer: minimal testing done.)

yuriy.babenko’s picture

Made a typo in the patch above. Corrected version attached.

yuriy.babenko’s picture

... and here's one with the proper file extension!

wundo’s picture

Status: Needs review » Needs work

This patch breaks the display for multi value checkboxes.

gagarine’s picture

Priority: Critical » Major
natted’s picture

I just tried to replicate this issue... but so far when I follow the steps, I do see a checkbox.

Have I missed something?

andregriffin’s picture

Project: Twitter's Bootstrap » Bootstrap Framework
wundo’s picture

Project: Bootstrap Framework » Twitter's Bootstrap

Moving back to the original project

natted’s picture

Project: Twitter's Bootstrap » Bootstrap
markhalliwell’s picture

I was able to reproduce this via #1947214: Problems on revision tab. @wundo can you please explain #4? I don't see how this breaks, maybe it doesn't since the form stuff seems to have been refactored since this issue was opened. Applying #3 outputs the same structure of markup for both checkboxes and radios. Looks good to me:

<div class="control-group form-type-radios form-item-status form-item">
  <label class="control-label" for="edit-status">Status </label>
  <div class="controls">
    <div class="form-radios" id="edit-status">
      <div class="form-type-radio form-item-status form-item">
        <input type="radio" class="form-radio" value="0" name="status" id="edit-status-0" style="">
        <label for="edit-status-0" class="option radio">Blocked </label>
      </div>
      <div class="form-type-radio form-item-status form-item">
        <input type="radio" class="form-radio" checked="checked" value="1" name="status" id="edit-status-1">
        <label for="edit-status-1" class="option radio">Active </label>
      </div>
    </div>
  </div>
</div>
markhalliwell’s picture

Status: Needs work » Needs review
FileSize
871 bytes

Re-rolled patched against latest dev

markhalliwell’s picture

Assigned: Unassigned » wundo

@wundo please review.

wundo’s picture

I'm unable to reproduce it on my local environment, #description works perfect to me

wundo’s picture

Status: Needs review » Postponed (maintainer needs more info)

Guys, I can't reproduce this on my local using the following checkbox:

$form['checkbox'] = array(
    '#type' => 'checkbox',
    '#title' => t('Checkbox'),
    '#description' => 'Description',
    '#title_display' => 'after',
  );

Could you clarify how to reproduce this using plain FAPI elements?

wundo’s picture

Assigned: wundo » markhalliwell
markhalliwell’s picture

Title: Single-value checkboxes not rendered properly » Checkbox or radio inputs without titles don't render
Assigned: markhalliwell » wundo
Status: Postponed (maintainer needs more info) » Needs review
FileSize
929 bytes

Ok, I was able to reproduce the original issue, which is the same issue that was happening in #1947214: Problems on revision tab.

Steps to reproduce:
- create boolean field on a node content type
- enter some 'help text' (description)
- use 'single on/off checkbox' as the widget

It has to do with the fact the the "On value" title is empty (ie: boolean). There is a checkbox on the field configuration page underneath the help text, that if checked, will allow the checkbox to be shown then:

Use field label instead of the "On value" as label

I actually agree with @wundo in #4 though now. The element output needs to be in $variables['#children'] not the standard $output like the others. The issue really lies in how the label is processed.

WorldFallz’s picture

i can confirm patch in #16 fixes the issue for me.

The easiest way to reproduce this bug is to:

  1. set the theme to bartik
  2. install and enable the diff module
  3. create an article or basic page that contains revisions
  4. view the 'compare revisions' tab -- note the radio buttons
  5. switch to bootstrap and view the 'compare revisions' tab again - note the missing radios
  6. apply the patch
  7. view the 'compare revisions' tab again -- note the reappearance of the radio buttons

So far I don't see any other ill effects-- will continue to test with the patch applied.

markhalliwell’s picture

Assigned: wundo » Unassigned
Status: Needs review » Reviewed & tested by the community

I'm marking this rtbc then.

markhalliwell’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Reviewed & tested by the community » Fixed

Thanks!

7.x-2.x - Committed cb42e88
7.x-3.x - Committed 10ad334

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

markhalliwell’s picture

Version: 7.x-3.x-dev » 7.x-3.0-beta1