When a checkbox spans multiple rows, row highlighting does not function as expected. Patch can very likely be improved.

-K

CommentFileSizeAuthor
tableselect.patch2.01 KBZen

Comments

Zen’s picture

Version: 5.x-dev » 6.x-dev

This also applies to HEAD.

Zen’s picture

Patch still applies cleanly to both 6 and 5.

stevenpatz’s picture

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

Is this still an issue?

Zen’s picture

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

Please avoid making pointless follow-ups under the pretext of cleaning up the issue queue.

stevenpatz’s picture

Version: 6.x-dev » 7.x-dev
stevenpatz’s picture

Version: 7.x-dev » 6.x-dev
moshe weitzman’s picture

how do we reproduce this?

Zen’s picture

<?php
  function test_form() {
    $form['checks'] = array('#type' => 'checkboxes', '#options' => array(0 => '', 1 => ''));
    return $form;
  }

  function theme_test_form($form) {
    $header = array(theme('table_select_header_cell'), 'col1', 'col2');
    $checks = array(drupal_render($form['checks'][0]), drupal_render($form['checks'][1]));

    $rows1 = array(
      array($checks[0], 'row11', 'row12'),
      array($checks[1], 'row21', 'row22')
    );

    $rows2 = array(
      array(array('data' => $checks[0], 'rowspan' => 2), 'row101', 'row102'),
      array('row111', 'row112'),
      array(array('data' => $checks[1], 'rowspan' => 2), 'row201', 'row202'),
      array('row211', 'row212')
    );

    return theme('table', $header, $rows1) . theme('table', $header, $rows2);
  }

  return drupal_get_form(test_form);
?>

If the above code is stuck into a new node and previewed using the PHP filter, it should display two tables that use checkboxes. Clicking a checkbox in the second table should demonstrate that the highlighting is broken when the checkbox is set to span more than one row.

I've only tested this against D5. At the time of rolling, this patch also applied to D6 - no idea about now, though.

Thanks,
-K

dpearcefl’s picture

Is this a need in current D6?

Status: Needs review » Needs work

The last submitted patch, tableselect.patch, failed testing.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.