Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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