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).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

flocondetoile’s picture

The patch attached.
For review.

flocondetoile’s picture

Status: Needs review » Active
flocondetoile’s picture

The 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 :

'registration_type' => is_array($registration_type) ? reset($registration_type) : $registration_type,
flocondetoile’s picture

flocondetoile’s picture

Status: Active » Needs review

Let the bot test it.

semei’s picture

I also think that these hooks are very important to have.

xywei’s picture

It helps me a lot,thank you!

Chris Matthews’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Status: Needs review » Needs work
Issue tags: +Needs reroll
FileSize
53.32 KB

The patch in #4 does not apply on the latest 7.x-1.x-dev - added needs reroll issue tag.

does not apply

john.oltman’s picture

Status: Needs work » Closed (outdated)