the fact that project_nodeapi() is a single hook being shared by both project_project and project_issue type nodes has already caused some confusion, and now, a critical bug (that was live on drupal.org for a few minutes): http://drupal.org/node/66146#comment-107953. that sucks. neither killes nor i noticed this particular problem, since the project code is so weird in so many ways. ;)
the attached patch fixes this confusion in hook_nodeapi(), by having project_nodeapi() (which will live directly in project.module, not project.inc) check the type of the given $node, and then call type-specific versions (project_project_nodeapi() in project.inc, and project_issue_nodeapi() in issue.inc) to do the real work. this will also solve http://drupal.org/node/65601
while i'm at it, i'm moving project_form_api() into project.module, to make it clear this is shared by all of the project module, not just project_project type nodes or something.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | project_nodeapi_reorg_4-6.patch | 2.39 KB | dww |
| project_nodeapi_reorg.patch | 5.48 KB | dww |
Comments
Comment #1
AjK commentedapplied and tested. Looks good.
regards
--AjK
Comment #2
gerhard killesreiter commentedComment #3
dwwapplied to HEAD and 4.7.
i'm still considering how much of this i want to backport to 4.6. the existing project_issue_nodeapi() in 4.6 is dead code until i commit something. but, there's no need for a project_project_nodeapi() yet. i'd like to leave a stub function, so we know it's there, even if it's not in use, and then commit the project_nodeapi() in project.module like i have in this patch...
not my top priority at the moment. ;)
Comment #4
dwwComment #5
dwwi decided to go with the empty stub version of project_project_nodeapi(), for maximum clarity and future ease of backporting, patches applying to all branches, etc.
Comment #6
dwwapplied the latest patch to 4.6.
Comment #7
(not verified) commented