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.
Comment | File | Size | Author |
---|---|---|---|
#2 | 545306-hook_node_type_op.patch | 10.84 KB | alexanderpas |
Comments
Comment #1
alexanderpas CreditAttribution: alexanderpas commentedsubscribing
Comment #2
alexanderpas CreditAttribution: alexanderpas commentedfirst patch...
Comment #3
Dries CreditAttribution: Dries commentedInteresting patch (I like), but no tests that need to be updated?
Comment #4
alexanderpas CreditAttribution: alexanderpas commentednope, no tests needed updating... however, i think this is being tested by other code that doesn't call it explicitly.
Comment #5
Dries CreditAttribution: Dries commentedThis looks good to me, so marking it as RTBC.
Comment #6
webchickOh, yes please! :D
Committed to HEAD.
Needs to be documented in the upgrade docs.
Comment #7
dropcube CreditAttribution: dropcube commentedFor reference, other hook that needs removing of $op is hook_filter, see #546336: hook_filter_info(): Remove $op from hook_filter()
Comment #8
emmajane CreditAttribution: emmajane commentedDocumentation 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.
Comment #9
alexanderpas CreditAttribution: alexanderpas commentedremember 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.
Comment #10
emmajane CreditAttribution: emmajane commentedThanks @alexanderpas!
I've updated that page as follows:
http://drupal.org/update/modules/6/7#remove_op
Can you please review? Thanks!
Comment #11
catchDocs changes look great.
Comment #12
alexanderpas CreditAttribution: alexanderpas commentedI have added an link back to this issue, and an additional link at the top.