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.

Comments

AjK’s picture

applied and tested. Looks good.

regards
--AjK

gerhard killesreiter’s picture

Status: Needs review » Reviewed & tested by the community
dww’s picture

Version: 4.7.x-1.x-dev » 4.6.x-1.x-dev
Priority: Critical » Normal
Status: Reviewed & tested by the community » Needs review

applied 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. ;)

dww’s picture

Status: Needs review » Needs work
dww’s picture

Status: Needs work » Needs review
StatusFileSize
new2.39 KB

i 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.

dww’s picture

Status: Needs review » Fixed

applied the latest patch to 4.6.

Anonymous’s picture

Status: Fixed » Closed (fixed)