You are here

function panels_everywhere_update_6100 in Panels Everywhere 6

The site_template variants should not use the IPE, so change them to use the standard render pipeline.

File

./panels_everywhere.install, line 55
Installation, update and uninstall hooks for Panels Everywhere.

Code

function panels_everywhere_update_6100() {
  $table = 'page_manager_handlers';
  $handlers = db_query("SELECT * FROM {" . $table . "} WHERE task = 'site_template'");
  $converted = 0;
  while ($handler = db_fetch_object($handlers)) {
    if (!empty($handler->conf)) {
      $handler->conf = unserialize($handler->conf);
      if (is_array($handler->conf) && isset($handler->conf['pipeline']) && $handler->conf['pipeline'] == 'ipe') {
        $handler->conf['pipeline'] = 'standard';
        drupal_write_record($table, $handler, array(
          'did',
        ));
        $converted++;
        drupal_set_message(t('Converted the @display site template to use the standard renderer.', array(
          '@display' => $handler->conf['title'],
        )));
      }
    }
  }
  if (empty($converted)) {
    drupal_set_message(t('No Panels Everywhere displays needed to have their settings updated.'));
  }
}