User login

content type

How to programmatically rename a content type (change node type machine name)

Set old_type if you want to programmatically update a node type / machine name.

(This is not about changing the type of a node, but changing what type is called on the machine-info level.)

$type->old_type is what node_type_save() checks for when updating a node type, if it's not set it will create a new node type even if orig_type is set to an existing bundle. So really all you need to do right before saving a modified content type is set the old_type to the orig_type, such as:

Drupal wish: Configuration setting to make all content types default to create new revision

Update: All this is superseded by an existing module, http://drupal.org/project/content_type_overview

Requests for this feature go all the way back to the days of Drupal 4.6, at the least:

create new revision by default
http://drupal.org/node/53149
(4.6 era post!)

This feature remains wanted-- here is the manual instructions, for Stanford.edu!

Syndicate content