Posted by pillarsdotnet on July 10, 2008 at 12:45pm
Jump to:
| Project: | TinyMCE |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
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| Attachment | Size |
|---|---|
| tinymce.admin_.inc_.diff | 709 bytes |
Comments
#1
http://drupal.org/node/245531