After enabling this module and checking the checkbox "Enable sort by role weights", warning message appears on the user roles page:

warning: uksort(): Array was modified by the user comparison function in ...sites/all/modules/role_weights/role_weights.module on line 161.

Everything is fine but

I'm using PHP Version 5.3.2-1ubuntu4.1, Drupal 6.16.

Comments

anvar.validi’s picture

Here's the code:

function theme_role_weights_admin_new_role($form) {
  $header = array(t('Name'), array('data' => t('Operations'), 'colspan' => 2));

  $user_roles = user_roles();
  if (variable_get('role_weights_reorder_forms', FALSE)) {
    uksort($user_roles, '_role_weights_rid_compare');
  }

  foreach ($user_roles as $rid => $name) {
    $edit_permissions = l(t('edit permissions'), 'admin/user/permissions/'. $rid);

    // Drupal core redirects if the rid is DRUPAL_ANONYMOUS_RID or DRUPAL_AUTHENTICATED_RID.
    // We prevent this by shifting the rid.
    _role_weights_shift_rid($rid);
    $rows[] = array($name, l(t('edit role'), 'admin/user/roles/edit/'. $rid), $edit_permissions);
  }
  $rows[] = array(drupal_render($form['name']), array('data' => drupal_render($form['submit']), colspan => 2));

  return drupal_render($form) . theme('table', $header, $rows);
}
pfaocle’s picture

Status: Active » Closed (cannot reproduce)

Can't reproduce. Please re-open if necessary.

pfaocle’s picture

Version: 6.x-1.5 » 7.x-1.x-dev
Status: Closed (cannot reproduce) » Active

Error occurs on 7.x-1.x-dev

smits.smiling@gmail.com’s picture

Issue summary: View changes

Same Problem for version 7.x-1.x-dev. Any solution?

pfaocle’s picture

pfaocle’s picture

pfaocle’s picture

Status: Needs review » Fixed
pfaocle’s picture

Assigned: Unassigned » pfaocle

Status: Fixed » Closed (fixed)

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