This bug depends on color_get_info and was reported on our track (#652274: Error Message from Color module with CKEditor). in color_get_palette you getting color_get_info, which return null when theme like Bluemarine don't support color module, this generate warnings:

warning: array_keys() [function.array-keys]: The first argument should be an array in /home/****/public_html/modules/color/color.module on line 138.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/****/public_html/modules/color/color.module on line 139.

You should check what was returned by color_get_info().

Comments

thekevinday’s picture

Version: 6.14 » 6.15

Bump version.

How about wrapping the color_get_palette(..) in an if (is_null(..)):

<?php
/**
 * Helper function to retrieve the color palette for a particular theme.
 */
function color_get_palette($theme, $default = false) {
  // Fetch and expand default palette
  $fields = array('base', 'link', 'top', 'bottom', 'text');
  $info = color_get_info($theme);
  $keys = array_keys($info['schemes']);
  foreach (explode(',', array_shift($keys)) as $k => $scheme) { 
    $palette[$fields[$k]] = $scheme;
  } 

  // Load variable
  return $default ? $palette : variable_get('color_'. $theme .'_palette', $palette);
?>

becomes:

<?php
/**
 * Helper function to retrieve the color palette for a particular theme.
 */
function color_get_palette($theme, $default = false) {
  // Fetch and expand default palette
  $fields = array('base', 'link', 'top', 'bottom', 'text');
  $info = color_get_info($theme);
  if (!is_null($info['schemes'])){
    $keys = array_keys($info['schemes']);
      foreach (explode(',', array_shift($keys)) as $k => $scheme) {
        $palette[$fields[$k]] = $scheme;
      }
  }

  // Load variable
  return $default ? $palette : variable_get('color_'. $theme .'_palette', $palette);
}
?>

is this safe to have no $palette[$fields[$k]] set?

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.