* Notice: Undefined index: editor in bueditor_sorted_roles() (line 834 of bueditor/admin/bueditor.admin.inc).
* Notice: Undefined index: alt in bueditor_sorted_roles() (line 835 of bueditor/admin/bueditor.admin.inc).
* Notice: Undefined offset: 3 in bueditor_sorted_roles() (line 833 of bueditor/admin/bueditor.admin.inc).

On a new Drupal site (tested using Pressflow) you get these warnings when visiting the Bueditor admin page.

I would suggest changing the lines of code from this

$broles[DRUPAL_AUTHENTICATED_RID]['weight'] = 11;
    foreach ($roles as $rid => $name) {
      $sorted[$rid] = array(
        'name' => $name,
        'weight' => (int) $broles[$rid]['weight'],
        'editor' => (int) $broles[$rid]['editor'],
        'alt' => (int) $broles[$rid]['alt']
      );
    }
    uasort($sorted, 'bueditor_rolesort');

to this

$broles[DRUPAL_AUTHENTICATED_RID]['weight'] = 11;
    foreach ($roles as $rid => $name) {
      $sorted[$rid] = array(
        'name' => $name,
        'weight' => isset($broles[$rid]['weight']) ? (int) $broles[$rid]['weight'] : 0,
        'editor' => isset($broles[$rid]['editor']) ? (int) $broles[$rid]['editor'] : 0,
        'alt' => isset($broles[$rid]['alt']) ? (int) $broles[$rid]['alt'] : 0,
      );
    }
    uasort($sorted, 'bueditor_rolesort');

Or something along those lines. Whatever would be appropriate defaults to avoid triggering a warning message.

Comments

ufku’s picture

Version: 6.x-2.2 » 6.x-2.x-dev
Status: Active » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

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