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.
Notice: Trying to get property of non-object in uc_roles_cron() line 42 /ubercart/uc_roles/uc_roles.module
if (!is_array($account->roles) || !count($account->roles)) {
to
if ($account && (!is_array($account->roles) || !count($account->roles))) {
The reason this error exists is that the uc_roles_expirations table has a user id that no longer exists
Hope this helps.
Comment | File | Size | Author |
---|---|---|---|
#5 | uc_roles.module-cron-user-fix-1402106.patch | 674 bytes | joelpittet |
#4 | uc_roles.module.patch | 600 bytes | joelpittet |
#1 | uc_roles.module.patch | 602 bytes | joelpittet |
Comments
Comment #1
joelpittetI attached the wrong patch and message:( see this one.
I removed the role expiration if the user doesn't exist
Comment #3
longwaveCan you reupload your patch? Both links give 404 for me, seems drupal.org has been having some trouble in the past couple of hours.
Comment #4
joelpittetI have attached again but just in case here is the code:
Comment #5
joelpittetWonder if it doesn't like the patch format...
Comment #6
wodenx CreditAttribution: wodenx commentedComment #8
TR CreditAttribution: TR commentedCan we address #911350: uc_roles_cron() does not scale (horribly) at the same time please? I'd prefer to combine these into one issue, because any patch here will get lost when that routine gets refactored, and any refactoring needs to be aware of the above.
Comment #9
TR CreditAttribution: TR commentedClosing in favor of getting this all done in #911350: uc_roles_cron() does not scale (horribly). Please contribute to that issue if you want to get this resolved.
Comment #10
mariagwyn CreditAttribution: mariagwyn commentedIs this really a duplicate? The issue you reference is for 6.x, this is for 7.x
Comment #11
longwaveThe fix will be the same, so it's best to work on the fix in 7.x where development is most active, then backport it to 6.x.