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? :)

Comments

dww’s picture

Assigned: Unassigned » sdboyer
Status: Active » Needs work

Sounds great. Wrong patch. ;)

sdboyer’s picture

StatusFileSize
new484 bytes

LOL. Boy was I tired. Sorry, `git-diff --no-prefix` instead of `git-diff --no-prefix --cached`. Proper patch attached.

dww’s picture

Still needs work since there's no hunk for project.api.php. ;)

sdboyer’s picture

Assigned: sdboyer » Unassigned
Status: Needs work » Active
StatusFileSize
new1.26 KB

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

dww’s picture

Status: Active » Fixed
Issue tags: +sandbox projects

My 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

sdboyer’s picture

Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -git phase 2, -sandbox projects, -git sprint 9

Automatically closed -- issue fixed for 2 weeks with no activity.