i'm checking the user has userpoints (represents money) enough to pay the price of the event
i do it at hook_node_registration_insert()

it works well, but i would like to be able to cancel the process if the user has no userpoints enough
how can i stop from this hook the registration flow?

Comments

leandro713 created an issue. See original summary.

rudiedirkx’s picture

The insert hook is way too late. It's an entity API hook. You can't use that for context things like validation.

You need a form validation hook. Do a form alter on the registration form, add your own validation handler.

leandro713’s picture

thanks for your help, mate

rudiedirkx’s picture

Status: Active » Fixed

No problem.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.