After a discussion in IRC with jrbeeman and miglius, we decided it'd be better to move all the code about signup limits per status per node (e.g. the {signup_status_node_limits} table and all UI related to it) into a separate submodule, out of signup_status itself. Furthermore, this submodule should use hook_form_alter() to hide the global signup limit on nodes -- it's confusing to have both.
As a first step, we're just going to remove all this code from signup_status itself. Then we can figure out how it should all work and add it in a new submodule once we've got a reasonable proposal and working code. If we need to harvest anything from the existing code, CVS will still have the older revisions around. We just want to simplify the main signup_status module to make porting easier.
p.s. However, we think it's best to keep the "mod_signup_count" field in signup_status itself. That's a separate question, which is "should this status count towards the global signup limit for a given node?". Although there's no hook yet in signup to make this feature work (see #359411: Add a hook to allow modules to alter the total signup count), we think it's reasonable to keep this data and UI in signup_status.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 359412-17.signup_status_limit_d5_data_migration.patch | 1.02 KB | dww |
| #10 | 359412-10.signup_status_limit_enforce.patch | 5.28 KB | dww |
| #10 | 359412-10.signups_full_error.png | 19.34 KB | dww |
| #10 | 359412-10.status_full_error.png | 30.8 KB | dww |
| #3 | 359412-3.signup_status_limit.spec_.pdf | 31.83 KB | dww |
Comments
Comment #1
jrbeemanThis all sounds like a good idea to me. Thanks for the input on it.
Comment #2
miglius commentedThe code about signup limits per status per node is now removed from the HEAD.
Comment #3
dwwNote: ASU has contracted me to work on this. I wrote a design spec that I'm attaching here for interested parties. I'll be implementing this in the very short term -- basically all this week. If anyone has any thoughts/concerns about the attached spec, please comment here ASAP. Thanks!
Comment #4
dwwFirst step is #578502: Move signup-related settings from node/N/edit to node/N/signups/settings if anyone is interested/available to review/test that.
Comment #5
dww#578502: Move signup-related settings from node/N/edit to node/N/signups/settings is now committed to signup. I posted an initial patch and some screenshots for the altered settings UI over at #241869: Improve interface for setting number of signups allowed per status if anyone wants to look...
Comment #6
dwwOne note about http://drupal.org/files/issues/359412-3.signup_status_limit.spec_.pdf -- since I wrote that spec, I've been thinking more about all of this and decided that the proposed {signup_log}.count_towards_limit value described on page #3 should really be an integer, not a bool, to handle the often-requested feature of "how do I signup myself and 3 friends?"... In that case, we'd save 4 in {signup_log}.count_towards_limit instead of 1. Make sense?
Also, moving this to the new component for limit-related issues.
Comment #7
dwwI did an initial commit of the new signup_status_limit module which basically just includes the settings UI. So #241869: Improve interface for setting number of signups allowed per status is now fixed, and I'm going to focus on making those settings actually do something. ;)
Comment #8
scottrigbyrockin! (should we mark http://drupal.org/node/45248 as dupe @ this point?)
Comment #9
dwwNo, that's not dupe. We're just going to have a sane way to solve that once this is all done...
Comment #10
dwwHere's an initial patch and some screenshots of trying to enforce the per-status limits based on the UI changes already committed and the spec.
The more I actually play with this, the more I have questions about how this aspect of the UI should really work... ;)
Attached patch is pretty much exactly how I envisioned it in the spec: when a signup form is being generated, the only valid status options are ones that haven't yet reached their limit. If all the status options are full, the signup form itself is replaced with a message (see 359412-10.signups_full_error.png). There's a special validation callback for the signup form to ensure that when the user is actually trying to submit the form, if the selected signup status is now full, they get a form validation error (see 359412-10.status_full_error.png).
However, here are some edge cases that seem a bit weird:
A) If a page is rendered with a signup form when all the status options are full, even if someone cancels or the limits change, the signup form is still gone and the user still thinks that signups are totally full.
B) While trying to signup, if they hit a validation error of any kind (either due to a full status or otherwise), if the totals or limits have changed, the status options available in the form will change, even on the validation error screen. In a way, this is a feature, and is the opposite behavior from (A), but it's still slightly wierd.
C) If a status was available when the signup form is rendered, but is full when they try to submit it, I have to keep the full option available in the list of choices, or FAPI throws the dreaded "An illegal choice has been detected" error. So, in this one case, you're presented with a status choice that will keep failing if you don't change it. Unless of course, someone with that status cancels or the limit is increased in the meanwhile, then it'll magically start being a valid choice again (see B). ;)
D) Via VBO, a signup admin can easily overfill a given status by mass editing signups and changing N signups to use a status that only has M available slots (where M < N). Again, maybe this is a feature, not a bug, and signup admins should be able to do whatever they want and disregard status values. However, in contrast, the form for signup admins to add other users is currently just another instance of the 'signup_form' form ID, and that form is therefore enforcing the per-status limits as described here...
Any thoughts and input on these issues, or usability feedback from testing the attached patch (use HEAD of signup_status and the end of DRUPAL-6--1 of signup) would be most appreciated.
Thanks!
-Derek
Comment #11
mlsamuelson commentedMy thoughts on:
A) This isn't great, but if, for instance a user has just cancelled a signup, chances are they're not super keen to re-signup, so probably not a huge concern.
B) Yes, it is a little weird, but it is kind of a feature, though it has the potential to confuse users.
C) The saving grace here is that the regular signup form is pretty darned short, so reloading the page and trying again doesn't "cost" the user much, and likely what they will try in this scenario.
D) This doesn't seem too problematic. In a way it's nice to have the administrative section behave with flexibility, but the more user-oriented signup form behave in another - even if an admin is using it.
I wouldn't consider any of these edge cases "blockers" that should prevent the patch from getting in. This is one of those things that probably needs some road testing to figure out what's best, but for starters is acceptable.
Comment #12
ln282 commentedMy thoughts:
A) My site doesn't allow non-admins to cancel their own signups, so this isn't likely to be much of an issue for us, and a lot of people might reload the page if they expected a signup form and didn't see one, so I think it would be self-correcting in most cases.
B) This sounds like mainly a feature-- it would be better to have an error message explaining why things changed, but I think most people would be able to figure out that the event was full, if suddenly the only status they could choose was "waitlist" for example.
C) I could see this causing problems (I think a lot of my users might panic if they were told "An illegal choice has been detected"), but, unless someone loaded the page in their browser, forgot about it for a long time (while the event filled) and then tried to signup using the old form, I think it would be a rare problem.
D) This is definitely a feature, IMO.
Comment #13
dwwOk, based on the feedback, I committed #10 to HEAD (with a minor change -- if there are no visible signup status options at all, we don't try to alter a NULL form element).
So, at this point, limits are *only* enforced during the end-user signup UI. Programatic signups or status changes aren't covered. However, I had a long IRC chat with ezra-g about all this. Basically, there's really no good way for signup_status_limit itself to enforce per-status limits in these cases. For example, having signup_sign_up_user() fail if the status limit is exceeded is the wrong time to fail if something like uc_signup or signup_pay is trying to save the signup after processing payment. :( Really, add-on modules should be asked to check these limits themselves at the appropriate point in their own code paths and workflows.
If/when #503368: Default Status on Signup is done, we can add some code to signup_status_limit so that if a new signup is happening and there's no visible signup_status form element (in which case the default status would be used) we could enforce the limit on that default status as if it was part of the signup form. However, that's obviously blocked on #503368.
So, this is back to active for any other changes that might need to happen to signup_status_limit itself, but the basic shell is now working...
Comment #14
dwwFYI: committed a few follow-up fixes for this:
http://drupal.org/cvs?commit=264608
http://drupal.org/cvs?commit=264620
Comment #15
dwwI opened up #581652: Add a {signup_log}.count_towards_limit column and adjust limit logic accordingly for the signup schema + API changes outlined in the spec I attached at #3... The only other changes to signup_status as a result of that don't really impact signup_status_limit module itself. So, I think this can safely be marked 'fixed' at this point... Folks interested in the outcome of the spec should meet me over at #581652.
Comment #16
dwwOh right, except I forgot the D5 to D6 data migration part. That should be handled here.
Comment #17
dwwYay for a trivial upgrade path. ;) It's so rare (but nice) when it works out like that. Tested this with a copy of ASU's {signup_status_node_limit} table and it worked just fine.
Comment #18
mlsamuelson commentedI tested the upgrade path and it works nicely. Glad it was trivial. :)
Comment #19
dwwHa, I knew it was too easy to be so simple. ;) I forgot that we also want to populate {signup_status_limit_node_setting} for any nodes that have per-status limits from the D5 table. ;) So, I added the following query:
Re-tested this, and it's good, so I committed to HEAD.
Phew! ;)
Comment #21
Balbo commentedI'm not sure, so is "signup limits per status per node" now in the signup module? I can't find documentation about it.