You are here

function simplenews_update_6006 in Simplenews 6.2

Same name and namespace in other branches
  1. 6 simplenews.install \simplenews_update_6006()

Make the simplenews content type a custom type.

File

./simplenews.install, line 655
Simplenews installation.

Code

function simplenews_update_6006() {
  $ret = array();

  // Convert existing node type or re-create it.
  // If _node_types_build() if called before update, the simplenews
  // node type gets deleted because simplenews_node_info() no longer exists.
  // In that case we re-create the node type.
  if ($type = node_get_types('type', 'simplenews')) {
    $type->module = 'node';
    $type->locked = FALSE;
    $type->custom = TRUE;
    node_type_save($type);
  }
  else {
    _simplenews_install_nodetype();
  }
  return $ret;
}