Closed (fixed)
Project:
BUEditor
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2011 at 18:12 UTC
Updated:
9 Feb 2011 at 14:30 UTC
* 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
Comment #1
ufku commentedCommitted, thanks.