Closed (duplicate)
Project:
TinyMCE
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2008 at 12:45 UTC
Updated:
11 Jul 2008 at 18:10 UTC
After enabling tinymce and visiting admin/settings/tinymce/add, the following warning appears:
warning: Invalid argument supplied for foreach() in /var/www/drupal6/includes/form.inc on line 1182.
This patch (both inline and attached) solves the problem, which is an incorrectly-initialized #default_value assignment. Apparently, for a "checkboxes" type form, an empty #default_value should be initialized to array() rather than NULL.
diff -ur orig/tinymce/tinymce.admin.inc patched/tinymce/tinymce.admin.inc
--- orig/tinymce/tinymce.admin.inc 2008-03-27 16:11:17.000000000 -0400
+++ patched/tinymce/tinymce.admin.inc 2008-07-10 08:31:18.000000000 -0400
@@ -117,7 +117,7 @@
$form['basic']['rids'] = array(
'#type' => 'checkboxes',
'#title' => t('Roles allowed to use this profile'),
- '#default_value' => isset($edit->rids) ? array_keys((array) $edit->rids) : NULL,
+ '#default_value' => isset($edit->rids) ? array_keys((array) $edit->rids) : array(),
'#options' => $roles,
'#description' => t('Check at least one role. Only roles with \'access tinymce\' permission will be shown here.'),
'#required' => TRUE
| Comment | File | Size | Author |
|---|---|---|---|
| tinymce.admin_.inc_.diff | 709 bytes | pillarsdotnet |
Comments
Comment #1
webchickhttp://drupal.org/node/245531