Some fixes to waitlist, and making the module waitlist aware and separating out some functionality into functions so the waitlist module can use them too (like counting registrations). This also by necessity fixes #2480453: Show something to the user when he's already registered by implementing the access hook; if the user is the one registered, they have access to see the field state even if that state isn't a registration form.

Also, created rule file for waitlist to move people from waitlist to registered if somebody cancels their registration.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Renee S’s picture

Example rule:

{ "rules_waitlist_rule" : {
    "LABEL" : "Rule - On delete of a registration, if wait list exists, promote in order to available slot.",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "registration" ],
    "ON" : [ "registration_delete" ],
    "IF" : [
      { "data_is" : { "data" : [ "registration:state" ], "value" : "complete" } }
    ],
    "DO" : [
      { "registration_waitlist_get_first_on_waitlist" : [] },
      { "registration_waitlist_action_promote_waitlist_to_available_space" : [] },
      { "mail" : {
          "to" : [ "fetch-waitlist-user:mail" ],
          "subject" : "You are now registered for [fetch-event:title]",
          "message" : "Your wait list status for the event has been promoted.  You are now registered for the event.",
          "language" : [ "" ]
        }
      }
    ]
  }
}
Renee S’s picture

FileSize
8.36 KB
Renee S’s picture

FileSize
12.89 KB

Sorry, fixed some ... things ;)

Renee S’s picture

Title: Make module waitlist aware » Make module more waitlist-aware, bonus: making waitlist work!
Issue summary: View changes
dsnopek’s picture

Here is another issue which patches registration_waitlist to automatically convert 'waitlist' registrations to 'complete' (rather than using Rules):

#2258117: Waitlist doesn't automatically change 'waitlist' registrations to 'complete' when slots become available

The issue summary there describes why I think this makes sense.

travelertt’s picture

Rerolled patch to work with current DEV. Also cleaned up patch some (removed .patch file that was included in patch).

In regards to #5. That patch doesn't account for capacity or count, and only promotes 1 registration instead of checking for more or checking the capacity versus the count of the registration.

Bruno Nery’s picture

How can I configure the waiting list to receive the registration of only one user?

Chris Matthews’s picture

Status: Needs review » Needs work

@travelertt, how did you create the patch in #6?

When I run:
git clone --branch 7.x-1.x https://git.drupal.org/project/registration.git
cd registration
curl -O https://www.drupal.org/files/issues/registration-waitlist-aware-2481203-...
git apply -v registration-waitlist-aware-2481203-6.patch

I get:
error: docroot/sites/all/modules/registration/includes/registration.field.inc: No such file or directory
error: docroot/sites/all/modules/registration/modules/registration_waitlist/registration_waitlist.module: No such file or directory
error: docroot/sites/all/modules/registration/registration.module: No such file or directory

You'll need to remove the following from your patch file:
error: docroot/sites/all/modules/registration/includes/registration.field.inc: No such file or directory
docroot/sites/all/modules/registration/modules/registration_waitlist/registration_waitlist.module: No such file or directory
docroot/sites/all/modules/registration/registration.module: No such file or directory

joelpittet’s picture

Assigned: Renee S » Unassigned
Issue tags: +Needs reroll

Yeah this just needs --relative from the project directory when creating within an existing project but really using the git release is probably best.

john.oltman’s picture

Status: Needs work » Closed (outdated)