Because of the way hook_nodeapi() works (we can't see "before" and "after" values in the 'update' $op), it's difficult to accurately detect when a sandbox is promoted to a full project. I started hacking in a hook_form_alter(), but that has its own potential annoyances due to node_load() caching. Then I realized it could all be solved with what I'm hoping is a very reasonable hook fired in project_promote_project_form_submit(), notifying listeners that a promotion has occurred and passing along the relevant project node. So I did that, and I've now tested this through - it works swimmingly for triggering the repo manager, which is what I need to do (rename/relocate the repos on disk when a promotion occurs).
Two line patch. One line's a comment. Pretty please? :)
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | notify-on-sandbox-promotion.patch | 1.26 KB | sdboyer |
| #2 | notify-on-sandbox-promotion.patch | 484 bytes | sdboyer |
| notify-on-sandbox-promotion.patch | 488 bytes | sdboyer |
Comments
Comment #1
dwwSounds great. Wrong patch. ;)
Comment #2
sdboyer commentedLOL. Boy was I tired. Sorry, `git-diff --no-prefix` instead of `git-diff --no-prefix --cached`. Proper patch attached.
Comment #3
dwwStill needs work since there's no hunk for project.api.php. ;)
Comment #4
sdboyer commentedIf there are any other issues with this, I'd appreciate it very much if you could try to think them through and put them out in a big list so that we can stop ping-ponging back and forth here - this is the last piece blocking namespaced sandboxes on gd.d.o, and I'm really trying to wrap it up.
Comment #5
dwwMy first comment was "wrong patch". The second comment, after seeing the patch, was that it was missing something documentation. I'm not trying to ping-pong here or intentionally slow anything down... I'm just doing my job as a maintainer.
Anyway, I fixed the project.api.php hunk to follow code/doc standards more closely, and did some other minor edits to the text. Committed to HEAD: http://drupal.org/cvs?commit=489016
Cheers,
-Derek
Comment #6
sdboyer commentedThanks!