Hi,

I think that node_node_type_insert (implements hook_node_type_insert) can be removed from content_types.inc for two reasons:
- The code used in this function is a duplicate of node_node_type_update, which checks for an old $info->type, but that's never been set in the function, so the code never get's executed.
-There's already a message given on creation of a content type in node_type_form_submit. So should we use node_node_type_insert to display a message as confirmation of creating a new content type, you would get two messages saying the same thing. I assume that's kinda unneeded ?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

30equals’s picture

Status: Active » Needs review
FileSize
903 bytes

i created a patch which basicly removes node_node_type_insert.

Jody Lynn’s picture

Status: Needs review » Reviewed & tested by the community

I agree with that assessment. This was added in commit 84afe0d9 for review.

Dries’s picture

This looks ok to me, but it would be good to get another +1 from a node/entity system expert.

sun’s picture

Priority: Normal » Minor

I got heavily confused as I mistakenly believed you were talking about node_node_type_update().

But yeah, the _insert hook is totally obsolete. The condition can never be true, since it is always old_type == type on node type creation.

This duplicate + needless hook implementation was most likely introduced when we converted most of the hooks in core to no longer use an $op parameter, but instead separate insert/update/etc hook names.

So this is good to go. :)

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the extra +1, sun. Committed to 8.x.

Status: Fixed » Closed (fixed)

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