Posted by cvangysel on May 28, 2011 at 3:18pm
2 followers
| Project: | Project |
| Version: | 6.x-1.x-dev |
| Component: | Projects |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
For my Summer of Code project I need to catch as much as information as possible. Currently only hook_project_maintainer_save is triggered, which doesn't specify if the saved maintainer was just added or not. Therefor I propose hook_project_maintainer_new($nid, $uid, $permissions).
Proposed patch is attached to this issue.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| hook_project_maintainer_new.patch | 1.73 KB | Ignored: Check issue status. | None | None |
Comments
#1
Seems weird to have a hook_project_maintainer_new() vs. hook_project_maintainer_save(). So, both hooks are called on new maintainers, while only the 2nd is called on update?
I'd rather:
A) Remove _save(), add both _add() and _update() hooks, and only invoke the right hook on the right operation. This would be in line with the D7 node API. This is what we had originally before we merged the two hooks into one. ;) See #69556-25: move "cvs access" tab into project, make it generic and the next few comments.
or perhaps:
B) Just add an $operation argument to the existing hook to specify 'add' vs. 'update' (like D6's hook_nodeapi).
Sure, either one breaks the existing API, but I'd rather break it and make it sane (before the 6.x-1.0 release) than leave it inconsistent and not providing enough information to be useful.
#2
New patch using your first proposal attached.