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
CommentFileSizeAuthor
tinymce.admin_.inc_.diff709 bytespillarsdotnet
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Status: Needs review » Closed (duplicate)