Skip to content

Instantly share code, notes, and snippets.

@generalredneck
Last active May 31, 2016 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save generalredneck/a0467581d4a86b2cfbba39f01539ebd4 to your computer and use it in GitHub Desktop.
Save generalredneck/a0467581d4a86b2cfbba39f01539ebd4 to your computer and use it in GitHub Desktop.
uuid: 845b3aca-74ce-44f9-8e0f-467b40788d69
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: oiPcm7fOyx1roO8lg23bHVpWRRiTIZF5RLGy6qQT-CU
id: upgrade_d7_node_type
migration_tags:
- 'Drupal 7'
migration_group: migrate_drupal_7
label: 'Node type configuration'
source:
plugin: d7_node_type
constants:
preview: 1
process:
type: type
name: name
description: description
help: help
title_label: title_label
preview_mode: constants/preview
display_submitted: display_submitted
new_revision: options/revision
create_body: create_body
create_body_label: body_label
destination:
plugin: 'entity:node_type'
migration_dependencies:
required: { }
optional: { }
<?php
namespace Drupal\wg_drupal7_migrate\Plugin\migrate\source;
use Drupal\node\Plugin\migrate\source\d7\NodeType as MigrateD7NodeType;
/**
* Drupal 7 Node types source from database.
*
* @MigrateDrupalSource(
* id = "wg_d7_node_type",
* source_provider = "node"
* )
*/
class NodeType extends MigrateD7NodeType {
/**
* {@inheritdoc}
*/
public function query() {
return $this->select('node_type', 't')
->fields('t')
->condition('type', array(
'admissions_checklist',
'admissions_marketing_forms',
'alumni_career',
'alumni_in_action',
'capstone',
'career_event',
'course',
'course_photo',
'doctoral',
'doctoral_student',
'dual_degree_student',
'evaluation',
'event',
'faculty',
'gallery',
'groups',
'links',
'news',
'peer_advisor',
'podcast',
'press',
'profile',
'project',
'publication',
'restricted',
'student',
'syllabus',
'video',
), 'IN');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment