Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
node system
Priority:
Critical
Category:
Task
Assigned:
Reporter:
Anonymous (not verified)
Created:
10 Oct 2008 at 01:54 UTC
Updated:
21 Sep 2021 at 20:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
catchSo in #306224: EOL Taxonomy sprint: add proper taxonomy term hooks I'm just using module_invoke_all('taxonomy_term_$op', $term) for each of the different hooks - since objects are now passed by reference in PHP5. So if we can ensure that every hook just takes a term object, then we could completely remove node_invoke_nodeapi() too.
Comment #2
recidive commentedHere is a patch.
Besides making function signatures consistent by removing non-existent arguments, it also make hook_nodeapi_load() implementations modify node object directly, instead of returning an array of values to be appended to node object.
Comment #3
damien tournoud commented@recidive: please remove the nodeapi_load stuff from your patch, as this hook as already been modified by the RTBC #324313: Load multiple nodes and terms at once.
Comment #4
recidive commented#324313: Load multiple nodes and terms at once is not yet commited.
I'm ok re-rolling this one when the other goes in.
Comment #5
damien tournoud commentedI'm just trying to prevent duplicated work.
Comment #6
Anonymous (not verified) commented@recidive: thanks for picking this up, please feel free to assign it to yourself.
Comment #7
recidive commentedRemoved
nodeapi_load()andnode_load()changes from patch as per request on #3, keeping only the signatures updates (sorry @Damien Tournoud, I thought you meant removing the signature updates).The patch is now strictly focused on making hook signatures consistent.
Here is a list of where/how hooks are called for reference:
Comment #9
robloachMoving to Drupal core since node.api.php is now a part of core: http://drupal.org/node/314870
Comment #10
robloachWhoops, moved the wrong issue. This issue is a duplicate of http://drupal.org/node/314244 .
Comment #11
recidive commentedThis is not a duplicate of #314244: remove $op from hook_nodeapi.
This issue is about code: making nodeapi function signatures consistent.
Comment #12
recidive commentedFixing taxonomy issues that caused tests to fail.
Comment #13
catchShould we merge this and the documentation issue? Seems like essentialy the same cleanup and it's possible now with modul.api.php - would make it easier to review on both ends I think.
Comment #14
recidive commented@catch: agreed.
I've added documentation to the patch. And closed the other issue.
Comment #16
recidive commentedRe-rolled.
Comment #17
recidive commentedWeird, testbot already tested the latest patch and all tests passed. But the result didn't get published here.See http://testing.drupal.org/pifr/file/1/2196
Comment #18
robloachThis might be out of scope for this issue, but looking at the patch, I see a lot of one line function calls:
Instead of having these one line function calls, could we just remove those functions and then rename their corresponding function calls to the proper nodeapi hook? For example, remove taxonomy_nodeapi_delete, and rename taxonomy_node_delete to taxonomy_nodeapi_delete. Remove taxonomy_nodeapi_validate, rename taxonomy_node_validate to taxonomy_nodeapi_validate....
Comment #19
recidive commented@Rob Loach : yes. but I think this is out of the scope of this issue. It would be better if it was done on "the get rid of $op from hook_nodeapi" one.
We should submit a new issue to remove those indirect calls.
It's not a -1 for your suggestion. I'm just trying to keep this patch as simple as possible, so it get in faster.
Anyway, thanks for the review!
Comment #20
catchTests pass, I read through the patch and it looks good.
We should sort out taxonomy_nodeapi_*, and also trigger.module needs similar treatment - but these can be followup patches. Nice work!
Comment #21
robloachGreat! Once this is in, we can hack at #344361: Remove cruft left by de-op nodeapi patch
Comment #22
dries commentedCommitted to CVS HEAD. Thanks! I almost forgot about this clean-up ... :)