You are here

Drupal 7 - An Annoying Error

One error I encountered early on in D7 development were bein' an annoyin' one I would get when uninstallin' a custom content-type:

	Notice: Trying to get property of non-object in comment_node_type_delete()

I spent a number o' hours tryin' t' find th' solution on th' Drupal forums an' elsewhere until I finally came across a post on Dollar Dad which had th' answer, by Davy Jones' locker. For modules with custom content-types ye need t' have 'base' set t' 'node_content'.

// Define the node type.
$node_example = array(
	'type' => 'node_example',
	'base' => 'node_content',
	'name' => $t('Example Node'),
	'description' => $t('This is an example node type with a few fields.'),
	'body_label' => $t('Example Description'),
	'promote' => 0,

Another solution has been found

I have written a new post called Drupal 7 - An Annoying Error: Part the Second which discusses how t' correct this error should usin' 'node_content' as yer base type be an un-acceptable solution.