Closed (fixed)
Project:
Signup
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
16 Dec 2008 at 07:54 UTC
Updated:
2 Jan 2009 at 18:10 UTC
Jump to comment: Most recent file
Now that #341382: Add primary key to signup_log table is in place, we can simplify a bunch of the code for node/N/signups which is doing some slightly weird things to key the users with either uid or anon_mail. Now, we can always key on sid. This will make the patch for #55168: tracking actual attendance easier, too.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 347601_hook_signup_cancel.5.patch | 3.76 KB | dww |
| #1 | 347601_signup_sid_simplify.1.patch | 10.04 KB | dww |
Comments
Comment #1
dwwThis removes a bunch of ugly code. The functionality is the same, yet the patch removes 57 lines and only adds 41 (9 of which are expanded PHPdoc comments). ;) I think the API for signup_cancel_signup() is more sane, now, too, given the sid key. And, since it's the 6.x-2.* series, I don't mind breaking compatibility to fix the API.
Any thoughts/objections/reviews/testing before I commit?
Comment #2
add1sun commentedyay for saner code and saner referencing. I think breaking API in V2 is fine since this makes so much more sense.
Comment #3
dwwGreat, thanks for the review. Committed to HEAD: http://drupal.org/cvs?commit=159262
Comment #4
dwwActually, the more I think about it, I think the new API for hook_signup_cancel() should be:
We've already got the fully loaded $signup object in signup_cancel_signup(). Why just pass the sid and uid, when we can pass an object with everything? Seems much more useful that way, doesn't cost us anything, and if we're already breaking the API, we might as well do it right. ;)
Thoughts?
Comment #5
dwwFYI: After further consideration, I just backported this (and related changes) into DRUPAL-6--1: http://drupal.org/cvs?commit=159750
Furthermore, as I think about hook_signup_cancel, it seems like the API should really be: hook_signup_cancel($signup, $node). The $signup object is more important than the $node, so it should come first. And, since we're breaking the API, we might as well break it all the way. Attached patch does this, and adds a signup.api.php file to document signup hooks (along the lines of the new convention in D7 core).
Comment #6
deviantintegral commentedThe hook looks good to me. Flipping the order makes sense; following my own convention of "make the code talk", I'd always say to someone "Cancel signup 1337 for node 123", so I would expect the API to be the same.
This is going to make notifications so much more powerful. Sweet!
Comment #7
dwwGreat, we're all agreed. Committed to HEAD and DRUPAL-6--1. Yay. ;)