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".
Comment | File | Size | Author |
---|---|---|---|
#3 | 1027630.patch | 1.39 KB | jhodgdon |
Comments
Comment #1
ilo CreditAttribution: ilo commentedSorry, wrong issue queue. Moving here.
Thanks jhodgdon!
Comment #2
jhodgdonThanks 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.
Comment #3
jhodgdonActually, 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.
Comment #4
ilo CreditAttribution: ilo commentedoh, yes, you are right. Thanks jhodgdon, documentation now seems ok for me, right in the place that originated the issue.
Comment #5
jhodgdonDo you want to mark as RTBC then ilo?
Comment #6
ilo CreditAttribution: ilo commentedsure ;)
Comment #7
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.