You are here

function fieldable_panels_panes_update_7114 in Fieldable Panels Panes (FPP) 7

Restore the default FPP bundle that may have been purged in update 7108.

File

./fieldable_panels_panes.install, line 704
Fieldable Panels Panes install file.

Code

function fieldable_panels_panes_update_7114() {
  if (!variable_get('fieldable_panels_panes_skip_default_type', FALSE)) {

    // Check if the FPP type exists.
    $found = db_select('fieldable_panels_pane_type', 'fppt')
      ->fields('fppt', array(
      'name',
    ))
      ->condition('name', 'fieldable_panels_pane')
      ->execute()
      ->fetchField();
    if (empty($found)) {
      ctools_include('export');
      $item = ctools_export_crud_new('fieldable_panels_pane_type');
      $item->name = 'fieldable_panels_pane';
      $item->title = t('Panels Pane');
      ctools_export_crud_save('fieldable_panels_pane_type', $item);
      return t('The default Fieldable Panels Pane entity type has been recovered.');
    }
  }
}