Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I noticed my registrations created in the Held state weren't being cancelled after about an hour like they're supposed to. So I ran cron manually. When I did, I got these notices:
- Notice: Trying to get property of non-object in registration_cron() (line 1160 of /var/www/asiancdc/trunk/docroot/sites/all/modules/registration/registration.module).
- Notice: Undefined variable: result in registration_cron() (line 1160 of /var/www/asiancdc/trunk/docroot/sites/all/modules/registration/registration.module).
- Notice: Trying to get property of non-object in registration_cron() (line 1160 of /var/www/asiancdc/trunk/docroot/sites/all/modules/registration/registration.module).
- Notice: Trying to get property of non-object in registration_cron() (line 1162 of /var/www/asiancdc/trunk/docroot/sites/all/modules/registration/registration.module).
- Notice: Trying to get property of non-object in registration_cron() (line 1160 of /var/www/asiancdc/trunk/docroot/sites/all/modules/registration/registration.module).
- Notice: Undefined variable: result in registration_cron() (line 1160 of /var/www/asiancdc/trunk/docroot/sites/all/modules/registration/registration.module).
- Notice: Trying to get property of non-object in registration_cron() (line 1160 of /var/www/asiancdc/trunk/docroot/sites/all/modules/registration/registration.module).
- Notice: Trying to get property of non-object in registration_cron() (line 1162 of /var/www/asiancdc/trunk/docroot/sites/all/modules/registration/registration.module).
Held registrations are still not cancelled after running cron. Not sure what's going on. It'd be nice to get this working soon.
Comments
Comment #2
bartidris CreditAttribution: bartidris as a volunteer commentedThere's a bug inside the registration.module file, in the
registration_cron()
function.This works for me:
For my site, I'm expiring held registrations against their
created
date. If you want to check against theirupdated
date you should use$registration_wrapper->updated->value()
instead of$registration_wrapper->created->value()
in the snippet above.Comment #3
fonant CreditAttribution: fonant commentedNeeded two fixes for me:
1. Patch to save the expiration time and expired state into the registration_type's data field:
https://www.drupal.org/project/registration/issues/2818141
2. Change line from 1161 (in release 7.x-1.6):
to:
Comment #4
Chris Matthews CreditAttribution: Chris Matthews commented