Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I use Signup to allow users to signup to event nodes. People sometimes forgets to add their signup and the administrator have to add these afterwards. But, in order to do that the signup has to bee open.
I want a setting to allow administrators to add users even if the signup is closed.
Comment | File | Size | Author |
---|---|---|---|
#10 | signup_admin-add-users-after-signup-closed-972254.patch | 2.95 KB | mstef |
#1 | signup-addusers2closed.patch | 2.08 KB | Magnus |
Comments
Comment #1
Magnus CreditAttribution: Magnus commentedAnd here is a patch to implement this. Please also review:
#242720: Mass/bulk user signup
#595414: Add rules event for signup
Comment #2
Magnus CreditAttribution: Magnus commentedComment #3
MasterChief CreditAttribution: MasterChief commentedHi magnus, i applied the patch but sadly it doesn't change anything.
The add link doesn't show up when signup are closed, is it the same for you ?
Comment #4
Magnus CreditAttribution: Magnus commentedThe setting is under the "advanced settings" at /admin/settings/signup
Comment #5
MasterChief CreditAttribution: MasterChief commentedOops, i missed it, it works now :)
Thank you very much!
Comment #6
Magnus CreditAttribution: Magnus commentedSomeone, please review the patch and set the status of the issue. I have been using this for a long time, but I don't want to set the issue to RTBC myself.
Comment #7
MasterChief CreditAttribution: MasterChief commentedIt works well :)
Comment #8
Magnus CreditAttribution: Magnus commentedThanks MasterChief! =)
Comment #9
mstef CreditAttribution: mstef commented1. You can't name a variable "signup_addusers2closed"
2. Booleans must always be in caps (FALSE, not false)
3. You never included the change to hook_uninstall to remove this new variable
4. In signup_sign_up_user(), I'd feel way more comfortable adding an additional argument to mark that an admin is performing the action, rather than just checking this variable every single time (because once it's set on, then $node->signup_status becomes completely irrelevant, and this check shouldn't be made on every hit).
Comment #10
mstef CreditAttribution: mstef commentedUpdated patch:
1. Renamed the variable.
2. Used 0 as a default instead of FALSE, as checkboxes use numeric booleans.
3. I saw that the maintainer used to not-recommended approach of querying the variable table to fetch the variable names. This is frowned upon for obvious reasons, but I'm not fixing it as it's out of scope for this patch.
4. signup_form() will now include the $signup_type as a form value, which is passed into the first argument for signup_sign_up_user(). If it's set to 'admin', it will check the variable we've created to allow the add. This module really should be using constants to define the values for things like $signup_type, but again, it's out of scope (and there are a lot of things that need to be fixed, so why get started now?).