The main idea is to provide two hook wich permit others modules to alter registration settings when an entity host is created or updated. It's an easy method wich permit to handle several use case as this issue Relative Date for Reminder Messages.
Attached a patch wich provides this 2 hooks (with drupal_alter) on registration_entity_insert() and registration_entity_update() implementations. These hook provide in the $context variable the entity host object.
These hooks are documented in registration.api.php. I also updated this doc with the hook available but not present in this file (hook_registration_status_alter).
Comment | File | Size | Author |
---|---|---|---|
#8 | Screen Shot 2018-12-21 at 8.39.00 PM.png | 53.32 KB | Chris Matthews |
Comments
Comment #1
flocondetoileThe patch attached.
For review.
Comment #2
flocondetoileComment #3
flocondetoileThe variable $registration_type is not consistent belong the user's role. With user-1 it's a string and with other roles it's an array...This patch handles this issue. The lines changed are :
Comment #4
flocondetoilethe patch
Comment #5
flocondetoileLet the bot test it.
Comment #6
semei CreditAttribution: semei commentedI also think that these hooks are very important to have.
Comment #7
xywei CreditAttribution: xywei commentedIt helps me a lot,thank you!
Comment #8
Chris Matthews CreditAttribution: Chris Matthews commentedThe patch in #4 does not apply on the latest 7.x-1.x-dev - added needs reroll issue tag.
Comment #9
john.oltman CreditAttribution: john.oltman at SiteBasin, Inc. commented