And probably others.

Comming from #1015124: should node type be custom in node_example_install? and http://api.drupal.org/api/drupal/modules--node--node.module/function/nod...

The question is what are the implications of the values for 'custom' and 'locked'.

According to the documentation for node_type_set_defaults, '"When populating a custom node type $info should have the 'custom' key set to 1.'

'Custom' set to 1 informs the node type form to hide the 'Delete' button for this content type, so it can't be deleted throug the user interface.
'Locked' means that the shortname can't be edited through the user interface.

Changing the short name of contrib provided nodes may lead to errors when other modules try to find them with the previous content type, but I'm not sure if that sentence should be updated to include "and 'locked' should be set to 1".

CommentFileSizeAuthor
#3 1027630.patch1.39 KBjhodgdon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ilo’s picture

Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Correction/Clarification » documentation

Sorry, wrong issue queue. Moving here.

Thanks jhodgdon!

jhodgdon’s picture

Thanks for tracking this down ilo!

I guess we need to add a note about the meanings of custom and locked (as described in this issue report) on
node_type_set_defaults() http://api.drupal.org/api/drupal/modules--node--node.module/function/nod...
although this is really an internal function used in the node module.

There's already a good description of locked on
hook_node_info() http://api.drupal.org/api/drupal/modules--node--node.api.php/function/ho...
and we don't have to worry about custom there (this is a node type module hook, and the system will set it to custom before saving the node type in the db).

So I guess node_type_set_defaults() is the only doc that needs updating for this issue.

jhodgdon’s picture

Status: Active » Needs review
FileSize
1.39 KB

Actually, you have it backwards on 'custom'. A value of 1 means that an admin created the type, and it can be deleted. See node_type_form(): http://api.drupal.org/api/drupal/modules--node--content_types.inc/functi...

Anyway, here's a patch to clarify the doc.

ilo’s picture

oh, yes, you are right. Thanks jhodgdon, documentation now seems ok for me, right in the place that originated the issue.

jhodgdon’s picture

Do you want to mark as RTBC then ilo?

ilo’s picture

Status: Needs review » Reviewed & tested by the community

sure ;)

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.