Needs work
Project:
Signup
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Jul 2010 at 18:35 UTC
Updated:
9 Jun 2011 at 16:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ezra-g commentedAnd, here's a patch.
Notes:
- This adds a 'user_reg_form' column to the signup table

- It adds a checkbox to the per-node signup settings, which looks like this:
- It adds a new theme function, theme_signup_node_title() that returns a title linking to the node and also includes the date formatted according to the node's date field formatter, if it exists. This is actually something we do in uc_signup.module, so it seems like uc_signup could just rely on this theme function if it makes it into signup.module.
Here's what the fieldset and checkboxes look like on the user registration form (in a theme that is in progress ;))

Comment #2
ezra-g commentedNow with 100% less parse error for upgrading users.
Comment #3
ezra-g commentedAnd if you'll forgive the mail spam, this version of the patch adds back in a feature for which I forgot the justification before posting here, so I removed it ;).
The 'sign up for content from the user registration form' permission might seems superfluous since we already have a 'sign up for content permission' that we could just grant to anons, but it makes sense for this use case: Users who are registering are anonymous when they register, but will be signed up *as registered users* so this permission satisfies the case where you only want authenticated users signing up for events, but want to make it easier for them to sign up as they are registering.
Comment #4
jm.federico commentedHi
did a quick check of your patch,
One question, shouldn't form alterations to user forms be made using hook_user(), when $op is "form" (for edits) or "register" (for new accounts).
Also, check at the code I have, this can be integrated with your patch. It presents admins with all open events on user registration form, so they can sign the new user when they create the account.
My sub-module is called signup_af (af for admin form).
Comment #5
jenlamptonThis patch only allows one user to sign up, and then complains that "anonymous" is already signed up for the event. I think you meant
$signup_form['uid'] = $account->uid;instead of
$signup_form['uid'] = $user->uid;on line 693.
Comment #6
ezra-g commentedMarking as NW based on the feedback above.
Comment #7
ezra-g commentedHere's a revised patch that implements hook_user() rather than hook_form_alter() -- Good catch, jm.federico. This also includes the fixed pointed out by jenlampton.
I didn't include the code for the proposed additional module to add the list of signups to the administrative form, but by using hook_user() case 'register' this functionality is working and assigns the signup to the newly created user.
I also made the list of nodes shown on the registration form alterable via drupal_alter(), and removed the 'sign up from the registration form' permission in favor of a setting under Signup's advanced settings, since this is arguably more of a setting than a permission, and was sufficiently confusing enough that I removed it from my initial patch and re-added it. As a setting, we can provide some descriptive text (that I've added) which explains how this feature relates to anonymous/authenticated users.
I also added the text "You will be automatically signed up once your account is created." above the list of events, to help set expectations.
Would love to get one more review before committing this :).
Comment #8
coltraneNeeds to be removed.
Powered by Dreditor.
Comment #9
ezra-g commentedIndeed, thanks! Here's a re-roll.
Comment #10
ezra-g commentedThis is committed - thanks!
I had some bad CVS metadata that denied me write access on a directory so this is unfortunately spread across two commits:
http://drupal.org/cvs?commit=473478
http://drupal.org/cvs?commit=473488
Go go Git migration!
Here it is as a single patch for porting.
Comment #11
dwwSorry I didn't look at this earlier. I have some objections. ;)
A) What happens when the signup form has custom fields? Total #fail from what I can see.
B) I don't think everyone creating a signup-enabled node should have permission to inject signup events into the site-wide user registration form.
There might be more, but that's what I noticed on a very quick skim. Drat, now I'm wishing I had made an RC7 not a 1.0 final. ;)
Comment #12
dwwC) I notice y'all added a
drupal_alter('signup_user_reg_nids', $nids);but there's no mention of this alter hook in signup.api.phpComment #13
ezra-g commentedThanks for your feedback.
I'm bummed to hear that you regret the 1.0 release after all the hard work that went into that, particularly given that this was in for review ~6 months ago
Fortunately, we can still address your points in a 1.1 release.
Comment #14
dwwI don't really regret the 6.x-1.0 release, I was kidding. I just think it's funny that the first thing I did with signup today was create the release, *then* i actually started looking at the code as I was syncing it with HEAD. ;) I'm still big thumbs up on all the effort you spent giving this module some much needed attention!
And yes, we can fix all this in 6.x-1.1... no worries.
Comment #15
dwwThis also introduced #1020758: Missing table prefix in query on line 643 of signup.module... ;)
Basically, the lessons for all of us should be:
- We shouldn't commit new features right before a major stable release.
- We should listen to our instincts when thinking another RC would have been a safe bet.
But yeah, none of this is a huge deal. I'm still super grateful for all the work on 6.x-1.0 release, and I'm glad it's finally out, even if it's not perfect (which it's never going to be, anyway)...
Comment #16
ezra-g commentedWe should also be checking the 'signup_user_reg_form' variable before displaying any events on the user registration form.
Comment #17
ezra-g commented> A) What happens when the signup form has custom fields? Total #fail from what I can see.
Indeed.
I think there are some features like the present one and #152659: Signup toggle link that don't really lend themselves to the signup custom fields approach and instead favor an "everyone must be a first-class user approach." I think the former is tough to accomodate in a range of use-cases and we should just document in the UI and/or README when there are features that don't work well with that approach.
My view of the signup custom fields approach (defining the fields in a theme function and serializing the values in a column in the DB) is that it's a quick way of building a super-simple site where it's not important for the data from the signup form to necessarily be re-usable in other places, and also one that is perhaps less necessary now with modules like http://drupal.org/project/signup_profile .
> B) I don't think everyone creating a signup-enabled node should have permission to inject signup events into the site-wide user registration form.
Totally agreed. Groups.drupal.org is one example of a site where that wouldn't fly.
And we still need to fix the issue in #16.
@dww - I'd love to rectify these issues, so let me know what you think, in particular of A!
Comment #18
ezra-g commentedHere's an patch that restricts users' ability to make events visible on the user registration form. Still need to address the undocumented API addition.
Comment #19
dwwThe theme function and serialized array in the DB is a nasty hack from the 4.6.x days of signup. However, I think we have different visions about signup data...
You, COD, http://drupal.org/project/signup_profile, etc, appear to think all data belongs in the profile, and the signup is basically just a node reference field for users (to record which nodes a given user cares about). However, in my case (the reason I started using Drupal and why I maintain this blasted module) signups are per-event/per-user meta data. I'm recording stuff like what instrument people are bringing to a gig. That's not something that can be recorded once in their profile. It depends on each user and each node they're signing up for (since I might bring different instruments to different gigs depending on who else signed up, etc). Granted, the implementation for these custom fields currently sucks, and we obviously need much better plumbing for them, but I don't think we should either forget about them entirely, nor say "well, if you really want that stuff, record it in better user profiles".
I think a big part of the problem is that the default custom fields (name/phone) are *exactly* the kind of data that *should* be in your profile, not in the signup (since presumably they're not changing from event to event). But, it's impossible to have reasonable default custom fields which make general sense. Probably it'd be better to have *no* default custom fields, and just have better docs on how to use them. But, I fear if we do that, we're more likely to break the functionality since it'll be out of sight and therefore out of mind.
If I was wearing a COD hat (I won't try to turn that into a codpiece pun -- oh wait, maybe I just did), I could invent a use-case for custom signup fields. Something like if you're planning to record the session with checkboxes for audio, video, note taking, etc. Lots of people attend sessions and record them, and maybe it's nice to get a sense of who's planning to take that level of care. Okay, maybe that's a stretch, but you get the idea, right? Or even something like an "I've got a question I'd like to ask at this session" checkbox. Useful data about the fact that user X is planning to be at event Y, which isn't a property of X nor Y, but of their intersection. Make sense?
Anyway, that's a bit of a digression from this particular patch and issue, but I wanted to clarify why I still care about custom signup data that's *not* in your profile. And that is what you just asked for my input on, so there you have it. ;)
Cheers,
-Derek
Comment #20
ezra-g commentedHey dww,
Thanks for the background info here!
Yes, there's definitely a lot of great use cases that call for per-event arbitrary fields. In my ideal world, we'd be using Webform for those fields but of course, that's a non-trivial development effort and there hasn't been a project or person with a commitment to doing that in an architecturally solid way.
Within the scope of this feature, I'm trying to get a sense of whether and how to integrate the custom fields in the user registration form.
Over at http://drupal.org/node/152659#comment-4423294, you said that
> If all you care about it a bit for if you're signed up or not (which is true for a lot of folks) a simple AJAXy toggle link is a step forward...
I was thinking that this feature is similar, in that if all you care about is if you're signed up or not, a simple *checkbox* would be a huge step forward.
Would you prefer that this get re-rolled to include the signup form serialized fields as part of the user profile form?