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,

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

create new revision by default
(4.6 era post!)

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

Syndicate content