Why can't a user register more than once, and why are the tables in the registration table set as unique?
Combined with Commerce Registration, imagine this scenario:
Site powered by Commerce/CR/Registrations creates registrations for tournament signups. In some cases, 1 coach signs up 1 team in a tournament, and there is no issue. In other cases, you have a coach who is the coach of multiple teams, and wants to register them in the same tournament.
Slots are not helpful- as these can't have signup limits. Also, each registration must be bought and processed separately, due to how the business runs their accounting/charging procedures.
I am trying to find a way to at least let the admins create new registrations for people who want more than one, but I am being stopped by Registrations, since it seems you cannot create more than one per user ID, here is the database error:
a:6:{s:5:"%type";s:12:"PDOException";s:8:"!message";s:1079:"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3311-commerce_product--107576' for key 'entity_id_entity_type_user': INSERT INTO {registration} (type, entity_id, entity_type, anon_mail, count, user_uid, author_uid, state, created, updated, order_id) VALUES
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | 1861364.29-registration-access-multiple-followup.patch | 4.04 KB | mrfelton |
| #26 | 1861364.26-registration-access-multiple-followup.patch | 2.2 KB | mrfelton |
| #24 | 1861364-registration-access-multiple-followup.patch | 678 bytes | mrfelton |
Comments
Comment #1
nicxvan commentedThis is uncanny, I came here to post the same issue, I can confirm bug exists.
Further the following option is checked off for the product:
"If selected, users can register for more than one slot for this event."
Comment #2
kevinquillen commentedI went into SQL and removed the unique index of entity_id_entity_type_user off the table and made adjustments to the commerce pane to allow this- I haven't seen any immediate side effect of doing this yet.
There are a couple of cases here.
1 person wants to sign up a group (slots)
1 person signs up an entity (team, just 1 slot)
1 person signs up multiple entities (teams, multiple registrations)
Slots can't always control this because you may want unlimited registration with no limit.
Comment #3
Bricks and Clicks MarketingI'm interested in this as well. Also wondering if 1 person registers a team, could they have some sort of control over the accounts they purchased?
Comment #4
rivimeyThis is sort of similar to a problem I have had... parents registering their children for activities at an event. For this, I made the children's names and other details subforms of the registration, which worked, but then each registration counted as one slot and it made some aspects of rendering the result difficult.
It would be nice to track using the slot system the children (but not the parent): in my case all children are separate, not "bundled", and parents don't count: they don't attend and are only involved as guardians.
Comment #5
Bricks and Clicks Marketing@rivimey: did that result in accounts for each of the children? And did the parent, as the buyer, have access to those accounts?
Comment #6
kevinquillen commentedI would think the complexity can be resolved by removing all the restrictions here, or adding to 'registration type' (Group, Individual, etc) something like that. But it's weird for users to register, then come back later and go oh yeah I need to add one more 'ticket' or what have you, and they get a big fat error.
Comment #7
rivimey@arphanus: as people were registering without having to create Drupal accounts, they were doing do anonymously as far as registration was concerned, and consequently for privacy's sake, nobody but the site owners could see the details. The reg form was filled in by the parent and the children's names were added as data.
I would have preferred a "sleeker" solution but am not even sure what it would look like. The thing I didn't want was to have to create a whole load of account registrations before starting, which would have presented a user-barrier to a largely non-tech audience.
I would agree with comment #6 conclusion.
Comment #8
mrfelton commentedExact same problem here. Either the system should accept multiple registrations for each event (the options in the registration settings seem to suggest that this should already be possible), or it should show an error message telling they can't register more than once. It definitely shouldn't end with a fatal error!
Personally, I can't see any good reason why the table needs rows to be unique in the way thats its set up now.
Comment #9
jason.fisher commentedTemporary workaround to redirect users to update their existing registration if it already exists.
Comment #10
tauno commentedThis is crossing paths with #1881212: registration_is_registered() should be smart about registration states
Comment #11
levelos commentedThe unique constraint on user registrations was removed in 521e1b99c82596857b97b241855e919ac490103a. We also altered how
registration_is_registered()works as discussed in #1881212: registration_is_registered() should be smart about registration states.Comment #12
nicxvan commentedStill getting
Email addresses must be unique for each registrant. Error
I updated today to the latest release. I did not test the dev version since it is only one day newer than the stable release.
Comment #13
nicxvan commentedI just realized this was posted to the dev version so I upgraded, I'm still getting the error.
I also received the following error the first attempt at updating:
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://worcesterfencing.com/update.php?op=selection&token=XMQseioTigJFhN... StatusText: OK ResponseText: Fatal error: require_once() [function.require]: Failed opening required '/home/worfence/public_html/sites/all/modules/registration/includes/registration.entity.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/worfence/public_html/includes/bootstrap.inc on line 3088
Comment #14
kevinquillen commentedDid you delete the unique index in the table as noted in #2?
Comment #15
simonjcarr commentedI have just upgraded the latest release of this module and am now getting this error when I checkout and am presented with the registration forms.
You cannot register yourself for the same item more than once.
Notice: Undefined property: Registration::$mail in commerce_registration_information_checkout_form() (line 74 of /var/www/vhosts/arduino-mega.com/simoncarr.co.uk/srrotary/sites/all/modules/commerce_registration/includes/commerce_registration.checkout_pane.inc).
Notice: Undefined property: Registration::$mail in commerce_registration_information_checkout_form() (line 74 of /var/www/vhosts/arduino-mega.com/simoncarr.co.uk/srrotary/sites/all/modules/commerce_registration/includes/commerce_registration.checkout_pane.inc).
As you can see as well as the error I still get the "You cannot register yourself for the same item more than once." error. I have also carried out the instruction in #2 (removed the unique index of entity_id_entity_type_user).
I have to go live with this site at the end of February so any help is much appreciated.
Comment #16
simonjcarr commentedJust to let you know that I also got an error when upgrading the registration module which prevented update.php from running. I ran manually afterwards and that sorted out the problem.
User can't register more than once? is still a problem however. I am not sure from reading the above posts if this issue has been fixed or not?
Could someone clarify what I need to do fix the error.
Thanks
Comment #17
simonjcarr commentedJust reading the above posts again and it looks as though the developers are trying the fix the problem that once a user has registered for an event once that they should then be able to register again at a later date.
My problem however is
That if I add 3 registrations to the cart and then checkout, I am presented with 3 registration forms as I would expect. If I choose Myself in more than one of them I get the User can't register more than once error. If I try to register for another person and use the same email address more than once I get the Duplicate email address error.
Can you confirm if there is a fix available this issue?
Comment #18
kevinquillen commentedCheck that the unique restraint is removed from your database table, my first guess.
Comment #19
simonjcarr commentedDo I delete this completely or just change it from Unique to Index?
Comment #20
simonjcarr commentedCould someone tell me which file holds the code that prevents the same user registering twice. I have now upgraded to the Dev version and deleted the unique index as described in #2 but I still cant regisetr the same person twice.
My plan is patch the code myself and see if I can get this working.
Thanks
Simon
Comment #21
levelos commentedI believe all the issues posted after #11 are related to Commerce Registration. This is an entirely different project with different maintainers, so please discuss related issues there. This thread is solely about changes to Entity Registration allowing the same user to register more than once, which, from everything we can tell, now works as designed.
Comment #23
kevinquillen commentedYes, as long as you remove the unique indexes on the table, it will allow it (I am using Commerce Registration).
Comment #24
mrfelton commentedI believe there is still an issue with this. Whilst the unique constraint has been removed, the registration_access_people() function still checks to ensure that a user is not already registered when determining if they have the permission to register for an event. The attached patch updates this so that it considered the ' Allow multiple registrations' option when determining wether to restrict based on wether the user is registered or not.
Comment #25
tauno commentedThe multiple_registrations setting is currently intended to allow a user to register for multiple slots with one registration. Probably makes sense to not mix that logic with the ability to create multiple registrations.
Could be split out into two settings - allow user to register for multiple slots and allow user to create multiple registrations.
Comment #26
mrfelton commentedUpdated patch introduces a new setting to allow users to register for a particular more than once.
Comment #27
4kant commentedmrfelton,
tried your patch. Thanks.
I can see the tab for registering again now. But when I try to register again I get the message "You are already registered for this event."
Tried all combinations in register-settings of the entity...
Btw: as user 1 I never had restrictions in registering more than once.
Comment #28
selfirian commentedmrfelton,
Same here I tried your patch, I get the extra option but when I try to register twice for an event I get an error message.
Is there something else I have to do in order to make this work, maybe I missed something.
Thanks for any support on this, if I can help let me know.
Comment #29
mrfelton commentedMissed one bit. Patch updated. Note that if you are using this in conjunction with commerce registration, you need to patch that too as it does its own checks to see if a user is already registered. See #1974546: User can't register more than once for corresponding patch,
Comment #30
4kant commentedThanks mrfelton, it´s working now.
I´m actually not using commerce registration but intend to soon.
Again thanks!
Comment #31
nhck commentedThank you for this. Tested and I hope it gets in.
Comment #32
levelos commentedA variation of the patch from #29 committed in f7054046499cf0e5f86481e4bf1ddb69327d9051. Thanks!