Can anyone help me, I got this notice:
Undefined index: highlighted in include() (line 120 of /home/xxx/public_html/modules/system/page.tpl.php).

what can I do about it?

Comments

jgsantos’s picture

You need to define a region called highlighted in the .info file from your theme.

Vc Developer’s picture

I'm getting the same message but with addition:

    * Notice: Undefined index: highlighted in include() (line 120 of /srv/drupal/7/development/drupal-7.10/modules/system/page.tpl.php).
    * Notice: Undefined index: sidebar_first in include() (line 132 of /srv/drupal/7/development/drupal-7.10/modules/system/page.tpl.php).
    * Notice: Undefined index: sidebar_second in include() (line 138 of /srv/drupal/7/development/drupal-7.10/modules/system/page.tpl.php).
    * Notice: Undefined index: corporateclean in drupal_theme_initialize() (line 100 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in _drupal_theme_initialize() (line 145 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Undefined index: corporateclean in drupal_theme_initialize() (line 100 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in _drupal_theme_initialize() (line 145 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in _theme_load_registry() (line 305 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Undefined index: corporateclean in drupal_theme_initialize() (line 100 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in _drupal_theme_initialize() (line 145 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Undefined index: corporateclean in drupal_theme_initialize() (line 100 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in _drupal_theme_initialize() (line 145 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in _theme_load_registry() (line 321 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in _theme_load_registry() (line 305 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in _theme_build_registry() (line 684 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in _theme_build_registry() (line 684 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in _theme_build_registry() (line 684 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in _theme_save_registry() (line 329 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Undefined index: corporateclean in theme_get_setting() (line 1301 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in theme_get_setting() (line 1338 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).
    * Notice: Trying to get property of non-object in theme_get_setting() (line 1348 of /srv/drupal/7/development/drupal-7.10/includes/theme.inc).

Who do I address these too?

Vc Developer’s picture

Are these being fixed so I can upgrade?

Vc Developer’s picture

Cancel that! I found the problem! I didn't move my site over.

johnnykrisma’s picture

I'm having the exact errors involving migrating a site, how did you fix yours?

davmorr’s picture

I ran into this cascading semi-failure with confusing stacks of errors being reported in the course of development for 'beyond-features/strongarm' deployment versioning and synchronization. I was able to track the error to some site values in the variables table that hadn't been properly serialized, so a few strings got inserted directly. When Drupal tries to unserialize these, some of these base-level site vars are not set properly and 'kablooey' (I believe that's the correct technical terminology).

The error that was illustrated here would seem to hint that the 'Theme default' value is not set properly. Two things to validate in the variables table in this occasion are:

  1. all values fields actually have values: "SELECT * FROM variable WHERE value = '' OR value IS NULL;"
    Note: even NULL value should be serialized as a boolean value (I believe)
  2. all values in the values fields must be serialized properly. Throw the following functions into a custom utility module (should work, didn't have time to test it):
function [module_name]__node_view ($node, $view_mode, $langcode) {
  // ... code code code 
  $result = db_query("SELECT value val FROM variable");
  $unserial_vals = array();
  foreach ($result as $record) {
    if ( !_is_serial($record->val) ) {
      $unserial_vals[] = $record->val;
    }
  }
  $dsm = (module_exists('devel')) ? 'dsm' : 'drupal_set_message'; 
  $dsm( (!empty($unserial_vals) ? $unserial_vals : 'All values have been properly serialized' );
  // ... code code code 
}
/**
 * check if string is serialized or not
 */
function _is_serial($str) {
	$data = @unserialize($str);
	return ($str === 'b:0;' || $data !== false) ? true : false;
}

If inserting/updating values into the variables table via direct SQL, as opposed to using the variable_set() function, be sure to properly encode each of the values being inserted, updated, or replaced in the SQL.

function _get_sql_safe_string($val) {
  return (is_int($val)) ? $val : '"' . mysql_real_escape_string($val) . '"';
}

Disclaimer: I am not recommending that the variables table be updated directly if at all possible, this can lead to serious config issues. My scenario had to do with 'priming the pump' with some low-level site config values that seemed to be inaccessible via Strongarm due to the bootstrap processing order hierarchy, that is unless called from the low-level hook 'hook_stream_wrappers()'. There is a full discussion on the this in the Strongarm issue queue: strongarm_set_conf() needs to be called sooner

My solution was to parse an array of the 'variable' table's name values that I needed from the system.admin.inc file, using the following function, and then pull their values using variable_get(), or SQL select statement, into an associative name=>value array by iterating through the name values array. If using the varible_get() method, the variable values can be re-serialized and SQL-safe encoded using the above '_set_sql_safe_string()' function with serialize: $sqlval = _set_sql_safe_string( serialize($val) ).

/**
 * Get the system variables names that are loaded early in the bootstrap process,
 *   which are retrieved from code in the core system.admin.inc file (system module)
 */
function _get_sysvars_values($exclusions=array()) {
  global $conf;
  $sys = file_get_contents($_SERVER["DOCUMENT_ROOT"] . '/modules/system/system.admin.inc');
  $ptrn_pre  = "variable_get\('";
  $ptrn_expr = '([a-z_]+)';
  $ptrn_post = "'";
  $pattern = "/" . $ptrn_pre . $ptrn_expr . $ptrn_post . "/";
  preg_match_all($pattern, $sys, $matches);
  $sysvars = array_unique($matches[1]);
  sort($sysvars);
  foreach($sysvars as $var) {
    if (array_key_exists($var, $conf) && !in_array($var, $exclusions)) {
      $results[] = $var;
    }
  }
  return $results;
}

Hope this makes sense and is helpful!