http://api.drupal.org/api/function/hook_node_type/7 needs to be split into hook_node_type_insert() hook_node_type_update() and hook_node_type_delete()

To do this, first find any hook implementations in core and change them too hook_node_type_$op($argument) instead of hook_node_type($op, $argument);, then do the same for hook documentation, and any tests which might implement the hook. Once that's done, you'll need to update modules/node/content_types.inc to change the module_invoke_all() calls to the correct hook and arguments. Tagging as novice but that shouldn't stop someone else taking this on if they want to clean up - we really need to remove $op from any remaining hooks before freeze.

CommentFileSizeAuthor
#2 545306-hook_node_type_op.patch10.84 KBalexanderpas
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexanderpas’s picture

subscribing

alexanderpas’s picture

Assigned: Unassigned » alexanderpas
Status: Active » Needs review
FileSize
10.84 KB

first patch...

Dries’s picture

Interesting patch (I like), but no tests that need to be updated?

alexanderpas’s picture

nope, no tests needed updating... however, i think this is being tested by other code that doesn't call it explicitly.

Dries’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me, so marking it as RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs documentation

Oh, yes please! :D

Committed to HEAD.

Needs to be documented in the upgrade docs.

dropcube’s picture

For reference, other hook that needs removing of $op is hook_filter, see #546336: hook_filter_info(): Remove $op from hook_filter()

emmajane’s picture

Documentation update:

I've added a draft for the module upgrade text to http://drupal.org/node/546634
Please edit that page and leave a comment here to say if (1) more work is needed or (2) the text is fine as written. Once that text is correct I will incorporate it into the main D6->D7 upgrade page.

alexanderpas’s picture

remember that we already have: Remove $op from hook_nodeapi, hook_user and hook_block
http://drupal.org/update/modules/6/7#remove_op

I would suggest merging and updating with that one, adjusting the title, and adding in a new link at the top.

emmajane’s picture

Thanks @alexanderpas!

I've updated that page as follows:
http://drupal.org/update/modules/6/7#remove_op

Can you please review? Thanks!

catch’s picture

Status: Needs work » Fixed
Issue tags: -Needs documentation

Docs changes look great.

alexanderpas’s picture

I have added an link back to this issue, and an additional link at the top.

Status: Fixed » Closed (fixed)
Issue tags: -Novice, -DIE

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